0% found this document useful (0 votes)
2 views

dbms lab manual 2

The document outlines various exercises related to creating and managing databases using XML and NOSQL tools, as well as designing front-end applications and forms. It includes specific aims, algorithms, and results for tasks such as XML database creation, NOSQL data management, front-end application design, and report generation. Additionally, it presents a case study on implementing a Railway Reservation System using Visual Basic and Oracle.

Uploaded by

aourclassroom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

dbms lab manual 2

The document outlines various exercises related to creating and managing databases using XML and NOSQL tools, as well as designing front-end applications and forms. It includes specific aims, algorithms, and results for tasks such as XML database creation, NOSQL data management, front-end application design, and report generation. Additionally, it presents a case study on implementing a Railway Reservation System using Visual Basic and Oracle.

Uploaded by

aourclassroom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Ex. No.

: 10 Create an XML database and validate it using XML schema

AIM
To create an XML database and validate it using XML schema.

XML Hierarchical (Tree) Data Model


The basic object in XML is the XML document. Two main structuring concepts are used to
construct an XML document: elements and attributes. Attributes in XML provide additional information
that describes elements. Complex elements are constructed from other elements hierarchically,
whereas simple elements contain data values. A major difference between XML and HTML is that XML
tag names are defined to describe the meaning of the data elements in the document rather than to
describe how the text is to be displayed.
It is possible to characterize three main types of XML documents:
■ Data-centric XML documents. These documents have many small data items that follow a specific
structure and hence may be extracted from a structured database. They are formatted as XML documents
in order to exchange them over the Web. These usually follow a predefined schema that defines the tag
names.
■ Document-centric XML documents. These are documents with large amounts of text, such as news
articles or books. There are few or no structured data elements in these documents.
■ Hybrid XML documents. These documents may have parts that contain structured data and other
parts that are predominantly textual or unstructured. They may or may not have a predefined schema.

If an XML document conforms to a predefined XML schema, then the document can be considered
as structured data.

XML Documents
An XML document is well formed if it follows a few conditions. In particular, it must start with an
XML declaration to indicate the version of XML being used as well as any other relevant attributes, as
shown in the first line in Figure 13.3. It must also follow the syntactic guidelines of the tree data model.
This means that there should be a single root element, and every element must include a matching pair of
start and end tags within the start and end tags of the parent element. must be well formed, and it must
follow a particular schema. That is, the element names used in the start and end tag pairs must follow the
structure specified in a separate XML DTD (Document Type Definition) file or XML schema file.

XML Schema
The XML schema language is a standard for specifying the structure of XML documents. It uses
the same syntax rules as regular XML documents, so that the same processors can be used on both. To
distinguish the two types of documents, we will use the term XML instance document or XML document
for a regular XML document that contains both tag names and data values, and XML schema document for
a document that specifies an XML schema. An XML schema document would contain only tag names, tree
structure information, constraints, and other descriptions but no data values.

Result
Thus an XML database is created and validated using XML schema.
Program:

XML File (books.xml)


<?xml version="1.0"?>
<x:books xmlns:x="urn:books">
<book id="bk001">
<author>Writer</author>
<title>The First Book</title>
<genre>Fiction</genre>
<price>44.95</price>
<pub_date>2000-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>

<book id="bk002">
<author>Poet</author>
<title>The Poet's First Poem</title>
<genre>Poem</genre>
<price>24.95</price>
<pub_date>2000-10-01</pub_date>
<review>Least poetic poems.</review>
</book>
</x:books>

XSD File (books.xsd)

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:books"
xmlns:bks="urn:books">

<xsd:element name="books" type="bks:BooksForm"/>

<xsd:complexType name="BooksForm">
<xsd:sequence>
<xsd:element name="book"
type="bks:BookForm"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="BookForm">
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="genre" type="xsd:string"/>
<xsd:element name="price" type="xsd:float" />
<xsd:element name="pub_date" type="xsd:date" />
<xsd:element name="review" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:schema>
Ex. No.: 11 Create Document, column and graph based data using NOSQL database
tools.

AIM
To create document, column and graph based data using NOSQL database tools.

Document-based NOSQL systems:


These systems store data in the form of documents using well-known formats, such
as JSON (JavaScript Object Notation). Documents are accessible via their document id, but
can also be accessed rapidly using other indexes.
Column-based or wide column NOSQL systems:
These systems partition a table by column into column families (a form of vertical
partitioning; see Section 23.2), where each column family is stored in its own files. They
also allow versioning of data values.
Graph-based NOSQL systems:
Data is represented as graphs, and related nodes can be found by traversing the
edges using path expressions.

MongoDB Data Model


The operation createCollection is used to create each collection:
db.createCollection()
MongoDB CRUD Operations
MongoDb has several CRUD operations, where CRUD stands for (create, read, update,
delete). Documents can be created and inserted into their collections using the insert operation,
whose format is:
db.<collection name>.insert(<document(s)>)
The parameters of the insert operation can include either a single document or an array of
documents.
The delete operation is called remove, and the format is:
db. <collection name>.remove(<condition>)
There is also an update operation, which has a condition to select certain documents, and a $set
clause to specify the update. It is also possible to use the update operation to replace an existing
document with another one but keep the same ObjectId. For read queries, the main command is
called find, and the format is:
db. <collection name>.find(<condition>)

RESULT
Thus document, column and graph based data is created using NOSQL database
tools.
Ex. No.: 12a FRONT END TOOLS

AIM
To design an application using Front end tools.

FRONT END
Front-end and back-end are terms used to characterize program interfaces and
services relative to the initial user of these interfaces and services. (The "user" may be a
human being or a program.) A "front-end" application is one that application users interact
with directly. A "back-end" application or program serves indirectly in support of the front-
end services, usually by being closer to the required resource or having the capability to
communicate with the required resource. The back-end application may interact directly
with the front-end or, perhaps more typically, is a program called from an intermediate
program that mediates front-end and back-end activities.

ALGORITHM
Step 1. Start.
Step 2. Create an application using frontend tools (VB/Java).
Step 3. Create a database in the backend using oracle.
Step 4. Design the frontend forms using buttons, textboxes, checkboxes, list etc.
Step 5. Enter, compare, display, delete, etc in database using information through forms.
Step 6. Stop.

RESULT
Thus an application using Front end tools has been designed.
Ex. No.: 12b FORMS

AIM
To design a form for a database.

FORMS
Forms interfaces are widely used to enter data into databases and extract
information from databases.

ALGORITHM
Step 1. Start
Step 2. Enter the database to which the text box should be connected.
Step 3. Enter the user name to which the form builder should be connected.
Step 4. Select at least one column from the available column.
Step 5. Click finish.
Step 6. The corresponding form will appear on the screen.
Step 7. For executing the form click on the run button.
Step 8. To insert or delete a record click the insert record or delete record button.
Step 9. Form builder has provisions such as to seek the first, last, next record etc.,
Step 10. Stop.

RESULT
Thus the form for a database has been designed.
Ex. No.: 12c MENU DESIGN

AIM
To write menu design for accessing databases.

MENU
In computing, a menu or menu bar is graphical control element. It is a list of options
or commands presented to an operator by a computer or communications system. Choices
given from a menu may be selected by the operator by a number of methods.

ALGORITHM

Step 1. Start.
Step 2. To create a menu using resource editor, click on Insert -> Resource.
Step 3. A dialog box containing a list of different resource editors appears. Select Menu-
>New.
Step 4. A menu bar with a rectangular box on it gets displayed. Double click on this box, a
dialog box with a Caption ‘Menu item properties’ appears.
Step 5. Enter the menu item name and menu ID value. No ID value has to be given, if popup
check box is selected.
Step 6. Click on Project -> Add to project -> Files, select .rc file and press OK. This will
include the ‘.rc’ file in the currently opened project.
Step 7. Right click on Header Files in the work space, select Add files to Folder. Select
resource.h header file in the dialog box.
Step 8. Stop.

RESULT
Thus Menu design for database accessing executed.
Ex No.: 12d REPORT GENERATION

AIM
To generate report for a sample database.

REPORT GENERATORS
Report generators are tools to generate human readable summary reports from a
database.

ALGORITHM
Step 1. Start.
Step 2. Click the query builder to insert a query.
Step 3. The username, password and database should be entered.
Step 4. The tables in the corresponding user will be displayed.
Step 5. From that include the required table.
Step 6. The table name and the columns will be displayed.
Step 7. Select the columns, and then the query will be displayed.
Step 8. Click next.
Step 9. Select wanted columns in the table and click next.
Step 10. If necessary add functions like average, sum etc., and click next.
Step 11. Select the template in the template list and click next.
Step 12. Stop.

RESULT
Thus the Report for a database has been designed.
Ex. No.:12e CASE STUDY - RAILWAY RESERVATION SYSTEM

AIM
To implement the Railway Reservation System using Visual Basic as front end and
Oracle as back end.

RAILWAY RESERVATION SYSTEM


This system is concerned with the reservation and cancellation of railway tickets to
the passenger. The users are required to register on the server for getting access to the
database and query result retrieval. Upon registration completion, each user has an
account which is essentially referred to as the ‘view level’ of the customer. The account
contains comprehensive information of the user entered during the registration and allows
the user to access their past reservations, cancellations, enquire about trains and train
schedule, seat availability and make afresh reservations. The user will also be able to
update their account details.

ALGORITHM
Step 1. Start.
Step 2. Collect the details of how the project is expected by the user and the atmosphere in
which it is going to work.
Step 3. Create the tables which are required by the project and insert the values in the
Oracle database (Back End).
Step 4. Design the forms which are required by the project by using Visual Basic (Front
End)
Step 5. Connect the front end (VB) to Oracle database by using ADO Data Control
Step 6. Execute the project.
Step 7. Stop.

RESULT
Thus the Railway Reservation System is implemented successfully.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy