Upload
afaaki
View
156
Download
0
Embed Size (px)
Citation preview
Airlines Reservation System
Entity- Relationship DiagramNormalization & File Mapping
Rashmi Singh ---- 060341049 Abhishek Sonkamble ----
060341059Paras Verma ----
060341063 Abhijeet Meshram ----
060341065Avinash Caullychurn ----
060341094
Agenda
Problem Statement – Airlines Reservation System
What to do List Definitions Entities & Attributes Identified Relationship Types between different Entities Entity - Relationship Diagram Normalization Dependencies Table Design for Entities
Airlines Reservation SystemCompany Detail: Jet Airlines offer numerous flights between various
destinations across India every day. Information is maintained about flights, which are Flight Number, Departure Time, Arrival Time, Departure City, Arrival City, Number of Seats etc.
Operational Structure: To reserve a seat on any of the Flight, a Customer calls a
toll-free Number and gives the Ticketing Agent his/her detail. Which include the personal details and credit card details.
If the seat is available the Ticketing Agent issues the Ticket stating the Ticket Number, Flight Details, Ticketing Conditions, Fare.
The Jet Ticketing policies requires that each customer must have a ticket and a Boarding Pass to board each flight. The Boarding pass is issued at Airport departure lounge in exchange for the ticket issued.
What to do List
Identify the main Entity type Identify the Relationship type Draw Entity-Relationship Diagram Normalize the Data Give the detailed Table Design for the
System
Entity: A “Thing” or “Object” in the Real world
that is distinguishable from all other Objects.
Attribute: Property of an Entity or which describes an
Entity.
Entity Set: A set of Entity of same type that share the
same properties or attributes.
Definitions
Primary Key:An Attribute that is unique and is used to
identify a single instance of Entity set.
Foreign Key:An Attribute or set of Attributes within one
relation that matches the candidate key of some relation.
Candidate Key:The set of attributes that uniquely
identifies each occurrences of entity type.
Definitions
Domain:Set of allowable values for one or more attributes.
Relation:A Relation is Table with Rows and Columns.
Degree:Number of Attributes it Contains.
Cardinality:Cardinality of relation is the number of Attributes
it contains. Relationship:
An association among entities is called Relationship.
Definitions E-R Diagram
Entities Identified
Flight_Detail Ticket_Detail Cust_Detail Trav_Agent Boarding_Pass
Attributes Identified Flight_Detail
Flight_No (PK) Dep_Time Arr_Time Dep_City Arr_City No_Seats
Ticket_Detail Ticket_No (PK) Fare Seat_No Ticket_Type Ticket_Cond Flight_No (FK) TravAg_Id (FK)
Boarding_Pass BP_Id (PK) Flight_No
(FK)
Trav_Agent TravAg_Id
(PK) TravAg_Name TravAg_Add TravAg_City TravAg_Phon
e
Cust_Detail Cust_Id (PK) Cust_Name Cust_Age Cust_Add Cust_Phone Cust_CardNo Ticket_No
E-R Symbol Set
Entity
AttributesPrimary Key
Foreign Key
Relationship
Connectors
Relationship Types
Ticket_No Flight_IdFlight_Id
Flight_Detail
Ticket_Detail
BP_Id Flight_IdFlight_Id
Flight_Detail
Broading_Pass
Has
Has
Relationship Types
Ticket_No Cust_Id
Ticket_Detail
Cust_Detail
Ticket_No
Trav_Agent
TravAg_Id
Ticket_Detail
TravAg_Id
Has
Has
Cust_Id
Entity-Relationship Diagram
Ticket_Detail
Flight_Detail
Boarding_Pass
Cust_Detail
Trav_Agent
Has
Has
Has
Has
Flight_Id
Flight_Id
Flight_Id TranAg_Id
TranAg_Id
BP_IdCust_Id Ticket_Id
Cust_Id
Ticket_Id
NormalizationNormalization is a process of simplifying the relationship between data in a record. It carried out for following reasons.
Purpose of Normalization.
• To Simplify the maintenance of data through updates, insertions, & deletions
• To allow simple retrieval of data in response to query and requests
• To avoid restructuring of data when new application requirements arises
• To structure the data so that any relationship can be easily represented
• To eliminate redundant data and ensures data dependencies
• Reduce the amount of space a database consumes and ensures that data is logically stored
First Normal Form: Eliminate duplicative columns from same table Create separate table for each group of related data Identify each row with a unique column or set of
columns Second Normal Form:
Meets requirements of First Normal Form Remove subsets of data that apply to multiple rows of
a table and place them in a separate table Create relationships between new tables through the
use of foreign the use of foreign keys Third Normal Form:
Meet requirement of 2nd Normal Form It removes columns that are not dependent upon
primary key
Normal Forms
Unnormalized DataFlight_No
Dep_Time
………………
No_Seats
Ticket_No
Seat_No
………………
BP_Id
TravAg_Id
TravAg_Name
………………
TravAg_City
Cust_Id
Cust_Name
………………
Cust_Phone
FD FD FDFD
FD
FD
Functional Dependencies Flight_Detail
Primary key - Flight_No Flight_No Dep_Time, Arr_Time, Dep_City,
Arr_City No_Seats, Ticket_No, BP_Id
Ticket_Detail Primary key - Ticket_No
Ticket_No Fare, Seat_No, Ticket_Type, Ticket_Cond
Trav_Agent Primary key – TravAg_Id
TravAg_Id TravAg_Name, TravAg_Add, TravAg_City, TravAg_City, Ticket_No
Continued…..
Functional Dependencies (Cont..)
Cust_DetailPrimary Key – Cust_Id
Cust_Id Cust_Name, Cust_Age, Cust_Add, Cust_Phone, Cust_CardNo
Note:There is no Partial Dependency.There is no Transitive Dependency.
After Removal of Functional Dependencies we obtain tables in First Normal Form
As there is no Partial & Transitive Dependencies we obtain tables in Third Normal Form
Table Design for Entities Flight_Detail
Attribute Type Size Key Constraint
Flight_No Varchar 10 PK Unique number
Dep_Time Time --- Time in 24 hour clock
Arr_Time Time --- Time in 24 hour clock
Dep_City Varchar 20 Valid city name
Arr_City Varchar 20 Valid city name
No_Seats Number 3
Table Design for Entities Ticket_Detail
Attribute Type Size Key Constraint
Ticket_No Number 10 PK Unique Number
Fare Number 6
Seat_No Number 3
Ticket_Type Varchar 20
Ticket_Cond Varchar 50 Conditions
Flight_No Varchar 10 FK
TravAg_Id Number 6 FK
Table Design for Entities Cust_Detail
Attribute Type Size Key Constraint
Cust_Id Number 10 PK Unique ID
Cust_Name Varchar 30 Customer Name
Cust_Age Number 3
Cust_Add Varchar 50 Address
Cust_Phone Number 11 11 Digit Number
Cust_CardNo Number 16
Ticket_No Number 10 FK
Table Design for Entities Boarding_Pass
Attribute Type Size Key Constraint
BP_Id Varchar 10 PK Unique ID
Flight_No Varchar 10 FK
Table Design for Entities Trav_Agent
Attribute Type Size Key Constraint
TravAg_Id Varchar 10 PK Unique ID
TravAg_Name Varchar 20
TravAg_Add Varchar 50
TravAg_City Varchar 20
TravAg_Phone Number 11 Should be Their