2. Introduction to the Project
To create a railway reservation system intended to
streamline the booking, cancellation and inquiry
processes that passengers might undertake, as well
as to support administrative functions for managing
train schedules and handling lost items.
Application of relational database
management principles through the
development of a robust, scalable, and
user-centric railway ticketing and
management system.
Objective Focus
It is designed to bring multiple benefits
to various stakeholders, including
passengers, railway administration and
database administrators.
Benefit
6. Simple
Derived
Stored
Multi-value
Single Value
Attribute Types
seat_number
All attributes except seat_number
first_name, last_name, email_id, contact_number, city, country, province,
route_id, start_station, end_station, train_number, source, destination,
arrival_time, departure_time, total_seats, days_operating, total_fare,
payment_status, reservation_status, no_of_passengers, booking_date,
reservation_id, description, no_of_items, date_lost, status
passenger_name and
residential_address
Composite
seats_available and distance
train_number, total_fare,
train_route
7. Constraints &
Domains
applied
Domains
• Primary Key Constraints
• email_id route_id,
train_number, reservation_id
• Foreign key Constraints
• train_number in Reservation,
passenger_email_id in
Reservation
• Check Constraints
• days_operating attribute in the
Route_and_Train table might
be restricted to actual days of
the week
• Entity integrity Constraints:
• No primary key value is NULL
Constraints
8. 1. Mapping Regular Entities
Mapping ERD
to Relations
4. Mapping of 1:1 Relationship
5. Mapping 1:N Relationship
• passenger, train, route and
reservation entities are mapped to
respective relations
2. Mapping Weak Entities
• Lost Items is mapped to a new
relation with description and
reservation_id as it’s primary
keys.
• Train and the Route are
mapped into a merged
relation
• train_number in Reservations
references Trains
• passenger_email_id in
Reservations references
Passengers
• route_id in Train references the
Route.
6. Mapping M:N Relationship
• Since there are no M:N
relationships identified in the
ERD, this step is NA.
3. Mapping Multi-valued
attributes
• A new relation Reservation_seat_number
is created and the reservation_id along
with seat_number are it’s primary keys.
9.
10. 1. Passenger Table:
This relation is in 1NF as there are no repeating groups or composite attributes. The primary key is email_id.
2. Route_and_Train Table:
It is in 1NF with train_number serving as a primary key. It was ensured that each attribute like start_station,
end_station, etc., only holds single, atomic values.
3. Reservation Table:
It is in 1NF as long as seat_number is considered atomic and not multi-valued. The primary key is
reservation_id.
4. Lost Item Table:
In 1NF with each attribute storing a single value.
5. Reservation_seat_number Table:
To be in 1NF, we have ensured that seat_number is a single value per row and not a list of seat numbers.
Normalization process
18. Query 1:
Retrieve all passengers’ names who ride the train in the year (2023) and the destination was
Toronto.For each passenger, retrieve the contact information
19. Query 2:
Retrieve the source, destination, departure time, arrival time for all the available trains and
sort this information based on the train number.
20. Query 3:
Calculate the annual income of each train during the year 2022 and 2023. Group them by the
year. Sort the year in ASC order.
21. Query 4:
Find the maximum income, the minimum income, and the average income for each train.
22. Query 5:
Retrieve all the booked and cancelled tickets and their related information such dates, train
numbers.
23. Query 5:
Retrieve all the booked and cancelled tickets and their related information such dates, train
numbers.
24. Query 6:
The management decided to add a new train. So, and by SQL commands, add a new train to the
database AND update any related tables. The information about the new train is as follows: Number
400
Source: Montreal, Destination: London (ON) , Departure time: 10:00, Arrival time: 15:00 , Total number
of seats available:120 , The price for this route will be 140$. The train will be just on Saturday’s.
26. Conlusion
This project highlights the effectiveness of relational
databases in improving operational efficiency and
scalability in transportation management systems with:
1.Robust Database Schema: Implemented with
integrity constraints to ensure data accuracy.
2.Efficient Data Management: Normalization reduced
redundancy, enhancing performance.
3.Dynamic Functionality: Executed complex SQL
queries for real-time data operations.
4.Scalability and Adaptability: Designed to
accommodate future expansions and changes.
27. References
2. Fundamental of Database Systems (7th
Edition), Elmasri & Navathe (2016)
3. Draw.io
Used to draw the relational schema diagram
https://draw.io/
4. MySQL
Used to implement the database system
1. Edraw Max Online. (2024)
Network Diagram Software
https://www.edrawmax.com/online/en/
Editor's Notes
In the digital age, the efficiency of transportation systems hinges significantly on the
robustness and responsiveness of their supporting informational infrastructures.Keeping these points in mind, the Railway reservation system is designed to facilitate passenger services for a hypothetical railway network. The primary scenario of this project
encompasses the management of train schedules, passenger bookings, ticket, validations, and cancellations through a centralized database system. The objective is to develop a
comprehensive database system that simulates real-world operations of a railway ticketing system. This project focuses on integrating various functionalities into a cohesive system that not only facilitates the operational needs of a railway service but also enhances the user experience for passengers. The project is expected to yield numerous benefits to various stakeholders such as railway administration.
The relational schema could potentially be refined to Second Normal Form by
eliminating the redundant source and destination attributes from the
route_and_train relation. These attributes have been retained for potential future scenarios where multiple trains might run on the same route but
with different starting or ending points..