SlideShare une entreprise Scribd logo
1  sur  25






ABC is an online bus booking system. There are 3
important entities(1) Bus
(2) Passenger
(3) Route
Any user can login and check for schedule of buses
using a username and e-mail address.
The route table has the details of schedule of every bus.
It has the attributes like departure date,departure
time,bus number,capacity, seat number,status,fare,route
name,source,destination and distance.






The status attribute checks whether any seat is
available or not.
Once,an available seat is viewed by the user,he goes
ahead for booking.
A user can book tickets for many passengers.
Booking will generate a ticket which has attributes like
ticket number and mode of payment.
The mode of payment can be either by cash or by credit
card.


Normalization is a process in which a given set of
relations is replaced by successive collections of
relations that have a simpler and more regular
structure.



It transforms data from a problem into relations while
ensuring data integrity and eliminating data redundancy.



4 most commonly used normal forms are first (1NF),
second (2NF), third (3NF) and Boyce-Codd (BCNF)
normal forms.


To make it feasible to represent any
relation in the database.



To free relations from undesirable
insertion,
update, and deletion anomalies.


Full Dependency:In a relation, the attribute(s) B is fully
functional dependent on A if B is functionally dependent
on A,but not on any proper subset of A.



Partial Dependency:If there is some attribute that can be removed
from A and the dependency still holds.
Eg. Pid,Pname->userid


Transitive Dependency
In a relation, if attribute(s) A->B and B->C,
then C is transitively dependent on A via B (provided
that A is not functionally dependent on B or C)
Eg. Bus_no->Route_No and Route_No->Route_name
– A table that contains one or more
repeating groups.
– To create an unnormalized table
 Transform the data from the information
source
 (e.g. form) into table format with columns
and rows.
ONLINE BUS BOOKING SYSTEMABC travels
Booking_date:
Username:

userid:
email:

Ticket No:
Departuredate:

Seatno:
Departuretime:

PassengerId:
PassengerAddress:
GENDER:

PassengerName:
DOB:
Phoneno:

Busno:
Capacity:
Routeno:
Source:
Distance:
Modeof payment:

Busname:
type:
Route-name:
Destination:
Fare:
• The table cells must be of single value.
• Eliminate repeating groups in individual
tables.
• Create a separate table for each set of related
data.
• Identify each set of related data with a
primary key.
The new tables are as follows:
1)USER
(userid,username,u_email)
2)PASSENGER
(Pid,phno,pname,paddress, DOB ,gender)
3)BUS_ROUTE
(routeno,busno,routename,source,destination,distance,
fare,dept_time,bname,capacity,type,
dept_date)
3)RESERVATION
(seatno,busno, status,bookingdate,
ticketno, mode_of_payment)
PASSENGER TABLE-(Pid,Phno->pname,paddress,Dob,gender)
Pid

phno

pname

paddress

DOB

gender

1

9676725456

Ram Sharma

Pune

6/1/1990

Male

2

9878767878

Siya Varma

sikar

3/5/1997

female

3

98786735

Siya Varma

sikar

3/5/1997

female

USER TABLE-(userid->username,u_email)

Userid

Username

U_email

111

Savita Marwal

savi@gmail.com

222

Himanish Mansinghani

himanish@yahoo.com
BUS_ROUTE(Busno,routeno-> bname,capacity,type,routename,source,
destination,distance,fare,dept_time, dept_date)
route Bus
no
no

route sourc
name e

desti
natio
n

dista
nce

2000

10

Delhi- delhi
Jaipur

Jaipur 2000k 2000
m

11:00
am

3/4/2
012

AA

20

a/c

2001

11

Pune- pune
mum
bai

mum
bai

12:p
m

4/4/2
012

BB

25

Non
a/c

200k
n

fare

500

Dept Dept Bus
capac type
_time _date name ity

RESERVATION TABLE-(seatno,busno->status,bookingdate,ticketno,mode_of_payment)
seatno

busno

status

bdate

ticketno

modeofpay
ment

1110

10

booked

1/4/2012

1122

Cash

1111

11

Booked

2/4/2012

1121

credit


A table is in 2NF if it is in 1NF and if all nonkey attributes are dependent on all of the
key.
1)USER
(userid->username,u_email)
2)PASSENGER
(pid-> pname,paddress, DOB, gender,userid)

3) CONTACTS
(pid,phid->phno)
4)BUS_ROUTE
(routeno,busno->bname,capacity,type,
source,destination,distance,fare,Dept_time,dept_date)
5)RESERVATION
(seatno,busno->status,
bookingdate,ticketno, mode_of_payment)
PASSENGER TABLE- (Pid(pk)->pname,paddress,Dob,gender,userid)
Pid

pname

101

DOB

gender

userid

Ram Sharma Pune

6/1/1990

Male

111

102

Siya Varma

sikar

3/5/1997

female

112

102

Siya Varma

sikar

3/5/1997

female

112

CONTACTS TABLE -

paddress

(phid(pk)->phno)

Phid

pid

phno

1

101

9887656789

2

102

9878789098

3

202

9767352453


A table is in 3NF if it is in 2NF and if it has
no transitive dependencies.
1)USER
(userid->username,u_email)
2)PASSENGER
(pid->pname,paddress,DOB, gender,userid)
3)CONTACTS
(pid,phno->phno)
(As, busno->routeno and routeno->distance)
Break BUS_ROUTE relation into 2 tablesa)BUS
(busno->bname,capacity,type,routeno)
b)ROUTE
(routeno->routename,source,destination,
dept_date,dept_time,distance,fare)
a)BUS (busno->bname,capacity,type,routeno)
busno

bname

capacity

type

routeno

10

AA

20

A/C

2000

11

BB

25

NON A/C

2001

b)ROUTE (routeno->routename,source,destination,
dept_date,dept_time,distance,fare)
routeno

routena
me

source

destinati
on

Dept_dat Dept_ti
e
me

distance

fare

2000

DelhiJaipur

Delhi

Jaipur

3/4/2012

11:00a.m

2000

2000

2001

PuneMumbai

Pune

Mumbai

4/4/2012

12:00p.m

200

500
FROM RESERVATION-{seatno->ticketno and
ticketno->modeof payment}

A)BOOKING
(seatno->pid,busno,status,ticketno)
B) TICKET
(ticketno->bookingdate,mode_of_payment)


A table is in BCNF if it is in 3NF and if every
determinant is a candidate key.



BCNF is a stronger form of 3NF
BCNF => 3NF
3NF ≠> BCNF



1)BOOKING
(seatno-> pid,busno,status)
seatno

pid

busno

status

1001

101

10

booked

1008

102

11

booked

Here,all the attributes other than seatno acts as a candidate key.
Eg,pid can act as a primary key alone.
Busno can also act as a primary key.
Status is not unique(i.e.either booked or available),so we
use(seatno and status) as candidate key.


A table is in 4NF if it is in BCNF and if it has
no multi-valued dependencies.


A table is in 5NF, also called "ProjectionJoin Normal Form" (PJNF), if it is in 4NF and
if every join dependency in the table is a
consequence of the candidate keys of the
table.
Online bus booking system-A Case study on Normalisation

Contenu connexe

Tendances

Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation SystemPriyanka Sharma
 
Synopsis on railway reservation system
Synopsis on railway reservation systemSynopsis on railway reservation system
Synopsis on railway reservation systemAnkit Verma
 
Online Bus Reservation System
Online Bus Reservation SystemOnline Bus Reservation System
Online Bus Reservation SystemSiva Rushi
 
railway reservation software documentaion
railway reservation software documentaionrailway reservation software documentaion
railway reservation software documentaionJoveria Beg
 
Hard copy of proj doc
Hard copy of proj docHard copy of proj doc
Hard copy of proj docnawaldiatm
 
Online travel booikng
Online travel booikngOnline travel booikng
Online travel booikngsanket shah
 
Railway Reservation system Case study of oracle db by cj date
Railway Reservation system Case study of oracle db by cj dateRailway Reservation system Case study of oracle db by cj date
Railway Reservation system Case study of oracle db by cj datememonsana
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONNandana Priyanka Eluri
 
Database Management System of Travel Co.
Database Management System of Travel Co.Database Management System of Travel Co.
Database Management System of Travel Co.Awais Ali
 
Online Bus Ticketing System
Online Bus Ticketing SystemOnline Bus Ticketing System
Online Bus Ticketing SystemKiran Shahi
 
Bus Ticket Management System Documentation
Bus Ticket Management System DocumentationBus Ticket Management System Documentation
Bus Ticket Management System Documentationmuzammil siddiq
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation systemSandip Murari
 
Online Bus Reservatiom System
Online Bus Reservatiom SystemOnline Bus Reservatiom System
Online Bus Reservatiom SystemNikhil Vyas
 
JUSTCABS - an Online Cab Reservation System (Final Year Project)
JUSTCABS - an Online Cab Reservation System (Final Year Project)JUSTCABS - an Online Cab Reservation System (Final Year Project)
JUSTCABS - an Online Cab Reservation System (Final Year Project)Amartya .
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 

Tendances (20)

Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation System
 
Synopsis on railway reservation system
Synopsis on railway reservation systemSynopsis on railway reservation system
Synopsis on railway reservation system
 
Online Railway reservation
Online Railway reservationOnline Railway reservation
Online Railway reservation
 
Online Bus Reservation System
Online Bus Reservation SystemOnline Bus Reservation System
Online Bus Reservation System
 
railway reservation software documentaion
railway reservation software documentaionrailway reservation software documentaion
railway reservation software documentaion
 
Dbms presentation!!
Dbms presentation!!Dbms presentation!!
Dbms presentation!!
 
Hard copy of proj doc
Hard copy of proj docHard copy of proj doc
Hard copy of proj doc
 
Online travel booikng
Online travel booikngOnline travel booikng
Online travel booikng
 
Railway Reservation system Case study of oracle db by cj date
Railway Reservation system Case study of oracle db by cj dateRailway Reservation system Case study of oracle db by cj date
Railway Reservation system Case study of oracle db by cj date
 
E-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATIONE-TICKETING ON RAILWAY TICKET RESERVATION
E-TICKETING ON RAILWAY TICKET RESERVATION
 
Database Management System of Travel Co.
Database Management System of Travel Co.Database Management System of Travel Co.
Database Management System of Travel Co.
 
Railway Reservation system
Railway Reservation systemRailway Reservation system
Railway Reservation system
 
Online Bus Ticketing System
Online Bus Ticketing SystemOnline Bus Ticketing System
Online Bus Ticketing System
 
Airline reservation system
Airline reservation system Airline reservation system
Airline reservation system
 
Bus Ticket Management System Documentation
Bus Ticket Management System DocumentationBus Ticket Management System Documentation
Bus Ticket Management System Documentation
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
Documentation of railway reservation system
Documentation of railway reservation systemDocumentation of railway reservation system
Documentation of railway reservation system
 
Online Bus Reservatiom System
Online Bus Reservatiom SystemOnline Bus Reservatiom System
Online Bus Reservatiom System
 
JUSTCABS - an Online Cab Reservation System (Final Year Project)
JUSTCABS - an Online Cab Reservation System (Final Year Project)JUSTCABS - an Online Cab Reservation System (Final Year Project)
JUSTCABS - an Online Cab Reservation System (Final Year Project)
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 

En vedette

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 
Bus Booking Management System
Bus Booking Management SystemBus Booking Management System
Bus Booking Management SystemMike Marshall
 
Online Bus ticket reservation
Online Bus ticket reservationOnline Bus ticket reservation
Online Bus ticket reservationSmit Patel
 
Online movie ticket booking
Online movie ticket bookingOnline movie ticket booking
Online movie ticket bookingmrinnovater007
 
Maxim mozgovoy. sberbank. crm
Maxim mozgovoy. sberbank. crmMaxim mozgovoy. sberbank. crm
Maxim mozgovoy. sberbank. crmECR Community
 
Paper sheremetyevo
Paper sheremetyevoPaper sheremetyevo
Paper sheremetyevoFilip Vl
 
Aeroflot Red Devils - Creative Brief !
Aeroflot Red Devils - Creative Brief ! Aeroflot Red Devils - Creative Brief !
Aeroflot Red Devils - Creative Brief ! Aeroflot Red Devils
 
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...Aeroflot - Russian airlines
 
Sberbank Europe Company Presentation (January 2014)
Sberbank Europe Company Presentation (January 2014)Sberbank Europe Company Presentation (January 2014)
Sberbank Europe Company Presentation (January 2014)Jennifer Gerstl
 
Lunch presentatie aeroflot vers.1.2 2016-11-28
Lunch presentatie aeroflot  vers.1.2 2016-11-28Lunch presentatie aeroflot  vers.1.2 2016-11-28
Lunch presentatie aeroflot vers.1.2 2016-11-28Airtrade Holland
 
Internationalization of civil aviation
Internationalization of civil aviationInternationalization of civil aviation
Internationalization of civil aviationkluchaninova
 

En vedette (16)

Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
ONLINE BUS BOOKING SYSTEM
ONLINE BUS BOOKING SYSTEMONLINE BUS BOOKING SYSTEM
ONLINE BUS BOOKING SYSTEM
 
Bus Booking Management System
Bus Booking Management SystemBus Booking Management System
Bus Booking Management System
 
Online Bus ticket reservation
Online Bus ticket reservationOnline Bus ticket reservation
Online Bus ticket reservation
 
Automated Bus Ticket Booking System
Automated Bus Ticket Booking System Automated Bus Ticket Booking System
Automated Bus Ticket Booking System
 
Normalization
NormalizationNormalization
Normalization
 
Online movie ticket booking
Online movie ticket bookingOnline movie ticket booking
Online movie ticket booking
 
Maxim mozgovoy. sberbank. crm
Maxim mozgovoy. sberbank. crmMaxim mozgovoy. sberbank. crm
Maxim mozgovoy. sberbank. crm
 
Aeroflot
AeroflotAeroflot
Aeroflot
 
Paper sheremetyevo
Paper sheremetyevoPaper sheremetyevo
Paper sheremetyevo
 
Aeroflot Red Devils - Creative Brief !
Aeroflot Red Devils - Creative Brief ! Aeroflot Red Devils - Creative Brief !
Aeroflot Red Devils - Creative Brief !
 
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...
Состоялось первое в 2015 году заседание Общественного совета Аэрофлота второг...
 
Sberbank Europe Company Presentation (January 2014)
Sberbank Europe Company Presentation (January 2014)Sberbank Europe Company Presentation (January 2014)
Sberbank Europe Company Presentation (January 2014)
 
Lunch presentatie aeroflot vers.1.2 2016-11-28
Lunch presentatie aeroflot  vers.1.2 2016-11-28Lunch presentatie aeroflot  vers.1.2 2016-11-28
Lunch presentatie aeroflot vers.1.2 2016-11-28
 
Internationalization of civil aviation
Internationalization of civil aviationInternationalization of civil aviation
Internationalization of civil aviation
 
Aeroflot
AeroflotAeroflot
Aeroflot
 

Dernier

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Dernier (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Online bus booking system-A Case study on Normalisation

  • 1.
  • 2.     ABC is an online bus booking system. There are 3 important entities(1) Bus (2) Passenger (3) Route Any user can login and check for schedule of buses using a username and e-mail address. The route table has the details of schedule of every bus. It has the attributes like departure date,departure time,bus number,capacity, seat number,status,fare,route name,source,destination and distance.
  • 3.      The status attribute checks whether any seat is available or not. Once,an available seat is viewed by the user,he goes ahead for booking. A user can book tickets for many passengers. Booking will generate a ticket which has attributes like ticket number and mode of payment. The mode of payment can be either by cash or by credit card.
  • 4.  Normalization is a process in which a given set of relations is replaced by successive collections of relations that have a simpler and more regular structure.  It transforms data from a problem into relations while ensuring data integrity and eliminating data redundancy.  4 most commonly used normal forms are first (1NF), second (2NF), third (3NF) and Boyce-Codd (BCNF) normal forms.
  • 5.  To make it feasible to represent any relation in the database.  To free relations from undesirable insertion, update, and deletion anomalies.
  • 6.  Full Dependency:In a relation, the attribute(s) B is fully functional dependent on A if B is functionally dependent on A,but not on any proper subset of A.  Partial Dependency:If there is some attribute that can be removed from A and the dependency still holds. Eg. Pid,Pname->userid
  • 7.  Transitive Dependency In a relation, if attribute(s) A->B and B->C, then C is transitively dependent on A via B (provided that A is not functionally dependent on B or C) Eg. Bus_no->Route_No and Route_No->Route_name
  • 8. – A table that contains one or more repeating groups. – To create an unnormalized table  Transform the data from the information source  (e.g. form) into table format with columns and rows.
  • 9. ONLINE BUS BOOKING SYSTEMABC travels Booking_date: Username: userid: email: Ticket No: Departuredate: Seatno: Departuretime: PassengerId: PassengerAddress: GENDER: PassengerName: DOB: Phoneno: Busno: Capacity: Routeno: Source: Distance: Modeof payment: Busname: type: Route-name: Destination: Fare:
  • 10. • The table cells must be of single value. • Eliminate repeating groups in individual tables. • Create a separate table for each set of related data. • Identify each set of related data with a primary key.
  • 11. The new tables are as follows: 1)USER (userid,username,u_email) 2)PASSENGER (Pid,phno,pname,paddress, DOB ,gender) 3)BUS_ROUTE (routeno,busno,routename,source,destination,distance, fare,dept_time,bname,capacity,type, dept_date) 3)RESERVATION (seatno,busno, status,bookingdate, ticketno, mode_of_payment)
  • 12. PASSENGER TABLE-(Pid,Phno->pname,paddress,Dob,gender) Pid phno pname paddress DOB gender 1 9676725456 Ram Sharma Pune 6/1/1990 Male 2 9878767878 Siya Varma sikar 3/5/1997 female 3 98786735 Siya Varma sikar 3/5/1997 female USER TABLE-(userid->username,u_email) Userid Username U_email 111 Savita Marwal savi@gmail.com 222 Himanish Mansinghani himanish@yahoo.com
  • 13. BUS_ROUTE(Busno,routeno-> bname,capacity,type,routename,source, destination,distance,fare,dept_time, dept_date) route Bus no no route sourc name e desti natio n dista nce 2000 10 Delhi- delhi Jaipur Jaipur 2000k 2000 m 11:00 am 3/4/2 012 AA 20 a/c 2001 11 Pune- pune mum bai mum bai 12:p m 4/4/2 012 BB 25 Non a/c 200k n fare 500 Dept Dept Bus capac type _time _date name ity RESERVATION TABLE-(seatno,busno->status,bookingdate,ticketno,mode_of_payment) seatno busno status bdate ticketno modeofpay ment 1110 10 booked 1/4/2012 1122 Cash 1111 11 Booked 2/4/2012 1121 credit
  • 14.  A table is in 2NF if it is in 1NF and if all nonkey attributes are dependent on all of the key.
  • 15. 1)USER (userid->username,u_email) 2)PASSENGER (pid-> pname,paddress, DOB, gender,userid) 3) CONTACTS (pid,phid->phno) 4)BUS_ROUTE (routeno,busno->bname,capacity,type, source,destination,distance,fare,Dept_time,dept_date) 5)RESERVATION (seatno,busno->status, bookingdate,ticketno, mode_of_payment)
  • 16. PASSENGER TABLE- (Pid(pk)->pname,paddress,Dob,gender,userid) Pid pname 101 DOB gender userid Ram Sharma Pune 6/1/1990 Male 111 102 Siya Varma sikar 3/5/1997 female 112 102 Siya Varma sikar 3/5/1997 female 112 CONTACTS TABLE - paddress (phid(pk)->phno) Phid pid phno 1 101 9887656789 2 102 9878789098 3 202 9767352453
  • 17.  A table is in 3NF if it is in 2NF and if it has no transitive dependencies.
  • 18. 1)USER (userid->username,u_email) 2)PASSENGER (pid->pname,paddress,DOB, gender,userid) 3)CONTACTS (pid,phno->phno) (As, busno->routeno and routeno->distance) Break BUS_ROUTE relation into 2 tablesa)BUS (busno->bname,capacity,type,routeno) b)ROUTE (routeno->routename,source,destination, dept_date,dept_time,distance,fare)
  • 19. a)BUS (busno->bname,capacity,type,routeno) busno bname capacity type routeno 10 AA 20 A/C 2000 11 BB 25 NON A/C 2001 b)ROUTE (routeno->routename,source,destination, dept_date,dept_time,distance,fare) routeno routena me source destinati on Dept_dat Dept_ti e me distance fare 2000 DelhiJaipur Delhi Jaipur 3/4/2012 11:00a.m 2000 2000 2001 PuneMumbai Pune Mumbai 4/4/2012 12:00p.m 200 500
  • 20. FROM RESERVATION-{seatno->ticketno and ticketno->modeof payment} A)BOOKING (seatno->pid,busno,status,ticketno) B) TICKET (ticketno->bookingdate,mode_of_payment)
  • 21.  A table is in BCNF if it is in 3NF and if every determinant is a candidate key.  BCNF is a stronger form of 3NF BCNF => 3NF 3NF ≠> BCNF  
  • 22. 1)BOOKING (seatno-> pid,busno,status) seatno pid busno status 1001 101 10 booked 1008 102 11 booked Here,all the attributes other than seatno acts as a candidate key. Eg,pid can act as a primary key alone. Busno can also act as a primary key. Status is not unique(i.e.either booked or available),so we use(seatno and status) as candidate key.
  • 23.  A table is in 4NF if it is in BCNF and if it has no multi-valued dependencies.
  • 24.  A table is in 5NF, also called "ProjectionJoin Normal Form" (PJNF), if it is in 4NF and if every join dependency in the table is a consequence of the candidate keys of the table.