Database Administration and Management
Database Administration and Management
Project Report
Railway Management
System
Submitted To:
Sir Asad UR Rehman
Submitted By:
Mubashar Ali (Bsf1900109)
Muhammad Ahtesham (Bsf1900426)
Jamshaid Javaid (Bsf1900334)
Numan Wazir (Bsf1800259)
1
Table of Contents
Index Topic Title Page No
2.1 Introduction
2.2 Objective
2.3 Scope
2.4 Key Stakeholders
2.5 Software requirements
2.6 Feature
3.1 Database Design
3.2 Relational Database Schema
2
Table of Figures
Index Topic Title Page No
3
Group Members
Jamshaid Javaid (Bsf1900334)
Introduction(2.1-2.3)
Database Design (3.1)
Context Level Diagram
Mubashar Ali (Bsf1900109)
Introduction (2.4-2.6)
Communication Level Diagram (Feature)
Sequence Diagram
Muhammad Ahtesham (Bsf1900426)
Database Design (3.2)
ER Diagram
Network Model Diagram
Numan Wazir (Bsf1800259)
Conclusion
4
2.1 Introduction
Railway Management System is our project and it has been developed and we can manage
Customers, Stations, Booking, Timetable, Trains and Fare from this project. The main objective
to develop Railway Management System is to overcome the manual errors and make a
computerized system.
In this project, there are various type of modules available to manage Trains, Stations, and
Customers. We can also generate reports for Stations, Customers, Timetable, and Fare. Here
the Customers module manage all the operations of Customers, Stations module can manage
Stations, booking module is normally developed for managing Booking, Timetable
module manages Timetable operations, Trains module has been implemented to manage Trains.
2.2 Objective
The Railway Management System facilitates the passengers to enquire about the trains available
on the basis of source and destination, Booking and Cancellation of tickets, enquire about the
status of the booked ticket, etc. The aim of case study is to design and develop a database
maintaining the records of different trains, train status, and passengers. This project contains
Introduction to the Railway Management system. It is the computerized system of reserving the
seats of train seats in advanced. It is mainly used for long route. In our country Pakistan, there
are number of counters for the reservation of the seats and one can easily make reservations and
get tickets. Then this project contains entity relationship model diagram based on railway
Management system and introduction to relation model. There is also design of the database of
the railway Management system based on relation model. Example of some SQL queries to
retrieves data from rail management database.
2.3 Scope
The global railway management system market can be segmented based on deployment model,
components, and region. In terms of deployment model, the market can be classified into on
premise and cloud. Based on components, the market can be bifurcated into services and
solution. The service segment can be further split into training and consulting, system integration
and deployment, and support & maintenance. The solution segment can be further sub-
segmented into rail operation management system, rail traffic management, rail asset
management system, rail control system, rail maintenance management system, passenger
information system, rail security, and others. The rail operation management system segment can
5
be further bifurcated into facility management solution, revenue management solution, ticketing
management solution, workforce management solutions, and rail automation management
solution. The rail traffic management system can be further sub-segmented into real-time train
planning and route scheduling solution, intelligent signaling solution, and centralized traffic
control solutions. The asset management system segment can be further split into train
information solution and track monitoring solution. The rail control system segment can be sub-
segmented into positive train control solution, communication based positive train control
solution, and communication-based train control solution and integrated control system.
My team members.
Railway Staff.
Railway Management
2.6 Features
This project is about creating the database about Railway Management System. The railway
management system facilitates the passengers to enquire about the trains available on the basis of
source and destination, booking and cancellation of tickets, enquire about the status of the
booked ticket, etc.
The aim of case study is to design and develop a database maintaining the records of different
trains, train status, and passengers. The record of train includes its number, name, source,
6
destination, and days on which it is available, whereas record of train status includes dates for
which tickets can be booked, total number of seats available, and number of seats already
booked. Passengers can book their tickets for the train in which seats are available. For this,
passenger has to provide the desired train number and the date for which ticket is to be booked.
Before booking a ticket for a passenger, the validity of train number and booking date is
checked. Once the train number and booking date are validated, it is checked whether the seat is
available. If yes, the ticket is booked with confirm status and corresponding ticket ID is
generated which is stored along with other details of the passenger. The ticket once booked can
be cancelled at any time. For this, the passenger has to provide the ticket ID (the unique key).
The ticket ID is searched and the corresponding record is deleted. With this, the first ticket with
waiting status also gets confirmed. List of Assumption Since the reservation system is very large
in reality, it is not feasible to develop the case study to that extent and prepare documentation at
that level. Therefore, a small sample case study has been created to demonstrate the working of
the reservation system. To implement this sample case study, some assumptions have been made,
which are as follows:
7
and corresponding record is searched in the Passenger. If the record exists, it is deleted. After
deleting the
record (if it is confirmed), first record with waiting status for the same train and same category
are searched from the Passenger table and its status is changed to confirm.
Database Tables
USER:
Column_Name DataType Nullable Column_ID
USER_ID NUMBER(2,0) No 1
FIRST_NAME VARCHAR2(10 BYTE) Yes 2
LAST_NAME VARCHAR2(10 BYTE) Yes 3
CNIC_NO VARCHAR2(14 BYTE) Yes 4 TRAIN:
GENDER VARCHAR2(1 BYTE) Yes 5
AGE NUMBER(2,0) Yes 6
MOBILE_NO NUMBER(10,0) Yes 7
EMAIL VARCHAR2(30 BYTE) Yes 8
CITY VARCHAR2(10 BYTE) Yes 9
STATE VARCHAR2(10 BYTE) Yes 10
PINCODE VARCHAR2(10 BYTE) Yes 11
PASSWORD VARCHAR2(20 BYTE) Yes 12
Column_Name DataType Nullable Column_ID
TRAIN_NO VARCHAR2(10 BYTE) No 1
TRAIN_NAME VARCHAR2(20 BYTE) Yes 2
ARRIVAL_TIME TIMESTAMP(6) Yes 3
DEPARTURE_TIME TIMESTAMP(6) Yes 4
AVAILABILITY_OF_SEATS VARCHAR2(5 BYTE) Yes 5
BOGGIES NUMBER(38,0) Yes 6
TICKET:
PASSENGER:
8
Column_Name DataType Nullable Column_ID
PASSENGER_ID VARCHAR2(10 BYTE) No 1
PNR_NO VARCHAR2(11 BYTE) Yes 2
AGE NUMBER(38,0) Yes 3
GENDER VARCHAR2(1 BYTE) Yes 4
USER_ID NUMBER(2,0) Yes 5
RESERVATION_STATUS VARCHAR2(5 BYTE) Yes 6
SEAT_NUMBER VARCHAR2(5 BYTE) Yes 7
PASSENGER_NAME VARCHAR2(20 BYTE) Yes 8
TICKET_ID VARCHAR2(10 BYTE) Yes 9
STATION:
BOOKS:
CANCEL:
REACHES:
STARTS:
9
Column_Name DataType Nullable Column_ID
TRAIN_NO VARCHAR2(10 BYTE) Yes 1
STATION_NO NUMBER(3,0) Yes 2
STOPS_AT:
----TRAIN----
create table TRAIN(
train_no varchar(10) CONSTRAINT train_no_pk primary key,
10
train_name varchar(20),
arrival_time TIMESTAMP ,
departure_time TIMESTAMP ,
availability_of_seats varchar(5),
date1 date );
insert into TRAIN values('34x','Pakistan Express','01-FEB-2022 11:00:00', '01-
FEB-2022 11:30:00', 'YES', '22-FEB-2022');
select * from TRAIN;
----STATION----
create table STATION(
no1 numeric(3) constraint no1_pk primary key,
station_name varchar(20),
arrival_time TIMESTAMP ,
train_no varchar(10),
foreign key(train_no) references TRAIN(train_no));
---TICKET---
create table TICKET(
ticket_id varchar(10) constraint ticket_id_pk primary key,
user_id numeric(2),
status varchar(5),
no_of_passengers int,
train_no varchar(10),
foreign key(user_id) references user1(user_id),
foreign key(train_no) references TRAIN(train_no));
---PASSENGER---
create table PASSENGER(
passenger_id varchar(10) constraint passenger_id_pk primary key,
pnr_no varchar(11),
age int,
gender varchar(1),
user_id numeric(2),
reservation_status varchar(5),
seat_numeric varchar(5),
passenger_name varchar(20),
ticket_id varchar(10),
foreign key (user_id) references user1(user_id),
11
foreign key(ticket_id) references TICKET(ticket_id));
----STARTS----
create table STARTS(
train_no varchar(10),
station_no numeric(3),
foreign key(train_no) references TRAIN(train_no),
foreign key(station_no) references STATION(no1));
-----STOPS_AT----
create table STOPS_AT(
train_no varchar(10),
station_no numeric(3),
foreign key(train_no) references TRAIN(train_no),
foreign key(station_no) references STATION(no1));
----REACHES----
create table REACHES(
train_no varchar(10),
station_no numeric(3),
reach_time timestamp,
foreign key(train_no) references TRAIN(train_no),
foreign key(station_no) references STATION(no1));
---BOOKS---
create table BOOKS(
user_id numeric(2),
ticket_id varchar(10),
foreign key(user_id) references user1(user_id),
foreign key(ticket_id) references TICKET(ticket_id));
---CANCEL---
create table CANCEL(
12
user_id numeric(2),
ticket_id varchar(10),
passenger_id varchar(10),
foreign key(ticket_id) references TICKET(ticket_id) ,
foreign key(passenger_id) references PASSENGER(passenger_id),
foreign key(user_id) references user1(user_id));
DIAGRAM
13
Conclusion
In our project Railway reservation system we have stored all the information about the Trains
scheduled and the users booking tickets and even status of trains, seats etc. This data base is
helpful for the applications which facilitate passengers to book the train tickets and check the
details of trains and their status from their place itself it avoids inconveniences of going to
railway station for each and every query they get. We had considered the most important
requirements only, many more features and details can be added to our project in order to obtain
even more user friendly applications.
14