B.Tech II Year II Semester (R16)
This lab enables the students to practice the concepts learnt in the subject
DBMS by developing a database for an example company named “Roadway Travels” whose description is as follows. The student is expected to practice the designing, developing and querying a database in the context of example database “Roadway travels”. Students are expected to use “Mysql” database.
The student is required to submit a document by writing the Entities and Keys to the
lab teacher.
Experiment 2: Concept design with E-R Model Relate the entities appropriately. Apply cardinalities for each relationship. Identify strong entities and weak entities (if any). Indicate the type of relationships (total / partial). Try to incorporate generalization, aggregation, specialization etc wherever required.
Example: E-R diagram for bus
Bus NO Source
BUS Destination
Date of Departu Journey re Time Reserv Ticket ation NO Sex Destinati Source on Ticket Departu Age re Time
The student is required to submit a document by drawing the E-R Diagram to the lab
teacher.
Experiment 3: Relational Model Represent all the entities (Strong, Weak) in tabular fashion. Represent relationships in a tabular fashion. There are different ways of representing relationships as tables based on the cardinality. Represent attributes as columns in tables or as tables based on the requirement.
Different types of attributes (Composite, Multi-valued, and Derived) have different way of representation. Example: The passenger tables look as below. This is an example. You can add more attributes based on your E-R model. This is not a normalized table. Passenger Name Age Sex Address Passport ID Ticket _id
The student is required to submit a document by Represent relationships in a tabular
fashion to the lab teacher.
Experiment 4: Normalization Database normalization is a technique for designing relational database tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of logical or structural problems, namely data anomalies. For example, when multiple instances of a given piece of information occur in a table, the possibility exists that these instances will not be kept consistent when the data within the table is updated, leading to a loss of data integrity. A table that is sufficiently normalized is less vulnerable to problems of this kind, because its structure reflects the basic assumptions for when multiple instances of the same information should be represented by a single instance only.
For the above table in the First normalization we can remove the multi valued attribute Ticket_id and place it in another table along with the primary key of passenger.
First Normal Form: The above table can be divided into two tables as shown below. Passenger Name Age Sex Address Passport ID
Passport ID Ticket_id
You can do the second and third normal forms if required. Any how Normalized tables are given at the end.
Experiment 5: Installation of Mysql and practicing DDL commands Installation of MySql. In this week you will learn Creating databases, How to create tables, altering the database, dropping tables and databases if not required. You will also try truncate, rename commands etc.
Example for creation of a normalized “Passenger” table. CREATE TABLE Passenger ( Passport_id INTEGER PRIMARY KEY, Name VARCHAR (50) Not NULL, Age Integer Not NULL, Sex Char, Address VARCHAR (50) Not NULL);
Similarly create all other tables.
Detailed creation of tables is given at the end.
Experiment 6: Practicing DML commands DML commands are used to for managing data within schema objects. Some examples:
Loading Question Papers
Fetching data from database...