C83PC5-DBMS Lab Manual 2021 (Exp 4-6)
C83PC5-DBMS Lab Manual 2021 (Exp 4-6)
NORMALIZATION OF TABLES
Aim: Apply the database Normalization techniques for designing relational database tables to
minimize duplication of information.
1NF
2NF
3NF
BCNF
4NF
5NF
BUS:
Passenger:
1
Reservation:
Cancellation:
Ticket:
2
Experiment 5
Step 1
Make sure you already downloaded the MySQL essential 5.0.45 win32.msi file. Double click
on the .msi file.
Step 2
This is MySQL Server 5.0 setup wizard. The setup wizard will install MySQL Server 5.0 release
5.0.45 on your computer. To continue, click next.
Step 3
Choose the setup type that best suits your needs. For common program features select Typical
and it’s recommended for general use. To continue, click next.
3
Step 4
Step 5
The program features you selected are being installed. Please wait while the setup wizard installs
MySQL 5.0. This may take several minutes.
4
Step 6
To continue, click next.
Step 7
To continue, click next.
5
Step 8
Wizard Completed. Setup has finished installing MySQL 5.0. Check the configure the MySQL
server now to continue. Click Finish to exit the wizard
d.
Step 9
The configuration wizard will allow you to configure the MySQL Server 5.0 server instance. To
continue, click next.
6
Step 10
Select a standard configuration and this will use a general purpose configuration for the server
that can be tuned manually. To continue, click next.
Step 11
Check on the install as windows service and include bin directory in windows path. To
continue, click next.
7
Step 12
Please set the security options by entering the root password and confirm retype the password.
To continue, click next.
Step 13
Ready to execute? Clicks execute to continue.
8
Step 14
Processing configuration in progress.
Step 15
Configuration file created. Windows service MySQL5 installed. Press finish to close the wizard.
9
10
Experiment 6
a) Passenger Table
SQL> create table Passenger(PNR_NO Integer primary key , Ticket_NO Integer, Name
varchar(20), Age Integer, Sex char(10), PPNO varchar(15));
Table created.
TICKET_NO INTEGER
NAME VARCHAR2(20)
AGE INTEGER
SEX CHAR(10)
PPNO VARCHAR2(15)
b) Reservation Table
Table created.
PNR_NO INTEGER
NO_OF_SEATS INTEGER
ADDRESS VARCHAR2(50)
11
CONTACT_NO INTEGER
STATUS CHAR(3)
c) Bus Table
SQL> create table Bus(Bus_No varchar(5) primary key, source varchar(20), destination
varchar(20));
Table created.
SOURCE VARCHAR2(20)
DESTINATION VARCHAR2(20)
d) Cancellation Table
Table created.
PNR_NO INTEGER
NO_OF_SEATS INTEGER
ADDRESS VARCHAR2(50)
CONTACT_NO INTEGER
STATUS CHAR(3)
e) Ticket Table
SQL> create table Ticket(Ticket_No Integer primary key, age Integer, sex char(4) Not
12
null, source varchar(2), destination varchar(20), dep_time varchar(4));
Table created.
AGE INTEGER
SOURCE VARCHAR2(2)
DESTINATION VARCHAR2(20)
DEP_TIME VARCHAR2(4)
Table altered.
Table altered.
Table altered.
1.3 INSERT
13
old 1: insert into Passenger (PNR_NO,TICKET_NO, 'Name', Age, Sex, PPNO)
new 1: insert into Passenger values(1,1,'SACHIN',12,'m','sd1234')
1 row created.
SQL> /
1 row created.
SQL> /
new 1: values(3,3,'swetha',24,'f','sdqw34');
1 row created.
SQL> /
new 1: values(4,4,'ravi',56,'m','sdqazx')
1 row created.
SQL> /
14
Enter value for pnr_no: 4
Enter value for ticket_no: 5
Enter value for name: asif
Enter value for age: 33
Enter value for sex: m
Enter value for ppno: iuyhjk
old 1: insert into Passenger (PNR_NO,TICKET_NO, Name, Age, Sex, PPNO)
1 1 SACHIN 12 m sd1234
2 2 rahul 34 m sd3456
3 3 swetha 24 f sdqw34
4 4 ravi 56 m sdqazx
1 row created.
SQL> /
15
new 1: insert into Bus values('2','hyd','chn')
1 row created.
SQL> /
1 row created.
SQL> /
1 row created.
SQL> /
16
Enter value for status: s
old 1: insert into Reservation (PNR_NO, No_of_seats, Address, Contact_No,Status)
1 row created.
1 row updated.
1 1 SACHIN 12 m sd1234
2 2 rahul 43 m sd3456
3 3 swetha 24 f sdqw34
4 4 ravi 56 m sdqazx
2.5 DELETE
17
SQL> delete from Passenger where PNR_NO='4';
1 row deleted.
1 1 SACHIN 12 m sd1234
2 2 rahul 43 m sd3456
3 3 swetha 24 f sdqw34
Table dropped.
18