Professional Documents
Culture Documents
Normalization Part 2
Normalization Part 2
ABOUT SYSTEM
ABC is an online bus reservation system. There are 3 important entities – 1) bus 2) passenger 30
route
Any user can login and check for schedule of busses using username and email address.
The other attributes are departure date, departure time, bus number, capacity, seat number, status,
fare, route name, source, destination, and distance.
Once, an available seat is viewed by the user, he goes ahead for booking.
Booking will generate ticket which has attributes like ticket number and mode of payment.
It transforms data from a problem into relations while ensuring data integrity and eliminating /
reducing data redundancy.
4 most commonly used normal forms are first normal form (1NF), second normal form (1NF), third
normal form (1NF), and Boyce-Codd normal form (BCNF).
OBJECTIVES
1) Full dependency
In a relation, the attribute(s) B is fully functionally dependent on A if B is functionally
dependent on A, but not on any proper subsets of A.
2) Partial dependency
If there is some attribute that can be removed from A and the dependency still holds.
Ex. P_id, p_name -> userid
3) Transitive dependency
In a relation, if attribute(s) A->B and B->C, the C is transitively dependent on A via B
(provided that A is not functionally dependent on B or C). Ex., Bus_no -> Route_no
And Route_no -> Route_name
UNNORMALIZED FORM
ABC TRAVELS
bookindDate userid email ticketNo D_date D_time P_id P_name P_address DOB
GENDE phn busN busNam Capacit typ routen routeNam sourc destinatio Far modeofpa
R o o e y e o e e n e y
1NF
User
Passenger
routeno busno routename source destination distance fare Dtime Ddate busName capacity type
2000 10 Delhi- delhi jaipur 2000km 2000 11:00am 3-4- AA 20 A/c
jaipur 2023
2001 11 Pune - pune mumbai 200km 500 12:00pm 4-4- BB 25 Non a/c
mumbai 2023
Reservation
2NF
A table is in 2 NF if it is 1 NF and if all non-key attributes are dependent on all of the key i.e., no
patrial dependency.
Passenger
3 NF
Route ( routeno -> routename, source, destination, Ddate, Dtime, distance, fare)
3NF
BCNF
Here, all the attributes other than seatno acts as a candidate key
status is not unique (i.e., booked or available), so we use (seatno and status) as candidate key.
User
Passenger
Contact
Bus
Route
Booking’
Ticket