DBMS Project Railway Reservation System
DBMS Project Railway Reservation System
MINI PROJECT
RAILWAY RESERVATION SYSTEM
ABSTRACT
The Railway Reservation 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 Railways reservation system. It is the computerized
system of reserving the seats of train seats in advanced. It is mainly used for long route. On-line
reservation has made the process for the reservation of seats very much easier than ever
before.
In our country India, 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 reservation system and introduction to relation model. There is also
design of the database of the railway reservation system based on relation model. Example of
some SQL queries to retrieves data from rail management database.
INTRODUCTION
Database is an organized collection of data. The data is typically organized to model aspects of
reality in a way that supports processes requiring information. A DBMS makes it possible for
end users to create, read, update and delete data in a database. The DBMS essentially serves as
an interface between the database and end users or application programs, ensuring that data is
consistently organized and remains easily accessible. The DBMS manages three important
things: the data, the database engine that allows data to be accessed, locked and modified and
the database schema, which defines the database's logical structure. These three foundational
elements help provide concurrency, security, data integrity and uniform administration
procedures. The DBMS can offer both logical and physical data independence. That means it
can protect users and applications from needing to know where data is stored or having to be
concerned about changes to the physical structure of data.
2 GROUP MEMBERS: KASHISH KHANDELWAL, NAINA NAUTIYAL, MISBA PARVEEN
PROJECT DESCRIPTION
This project is about creating the database about Railway Reservation System.
The railway reservation 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, 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.
PASSENGER passenger_id
name
gender
age
pnr_no
seat_no
booked_by
reservation_status
TRAIN Train_no
train_name
source
destination
arrival_time
Departure_time
availability_of_seats
train_no
A_seats1
A_seats2
A_seats3
B_seats1
B_seats2
B_seats3
W_seats1
W_seats2
W_seats3
STATION Station_no
Station_name
train_no
arrival_time
hault
TICKET Ticket_id
train_no
booked_user
Status
no_of_passengers
4 GROUP MEMBERS: KASHISH KHANDELWAL, NAINA NAUTIYAL, MISBA PARVEEN
Booking
Management
Train Ticket
Management Railway Management
Reservation
System
Login
Management
Train
Train Generate
GenerateTrains
Trains
Management
Management Report
Report
Booking
Booking Generate
Management
Management Booking Report
Ticket
Ticket Generate Ticket
Management
Management Railway
Railway Report
Reservation
Reservation
System
System Generate Route
Route
Route
Management Report
Login
Login Check User Login
Management
Management Details
System
SystemUser
User Generate
Management
Management System User
Report
Login to Check
Admin System Roles of
Access
Forgot
Check Manage
Password
Credenti Module
als s Manage Booking Details
ER-DIAGRAM
8 GROUP MEMBERS: KASHISH KHANDELWAL, NAINA NAUTIYAL, MISBA PARVEEN
SCHEMA DIAGRAM
9 GROUP MEMBERS: KASHISH KHANDELWAL, NAINA NAUTIYAL, MISBA PARVEEN
TABLE-2
create table TRAIN(train_no int primary key,train_name varchar2(50),arrival_time
TIMESTAMP,departure_time TIMESTAMP,
TABLE-3
create table STATION(Station_no int primary key, Station_Name varchar2(50),hault
int,arrival_time TIMESTAMP,train_no int,
TABLE:-4
create table TRAIN_STATUS(train_no int primary key,b_seats1 int,b_seats2 int,a_seats
int,a_seats2 int,w_seats int,w_seats2 int,farel float,fare2 float);
TABLE-5
create table TICKET(Ticket_id int primary key,user_id int,status char,
TABLE-6
create table PASSENGER(passenger_id int primary key,pnr_no int,
TABLE-7
create table STARTS( train_no int primary key, station_no int,
TABLE-8
create table STOPS_AT( train_no int,station_no int,
TABLE-9
create table REACHES(train_no int,station_no int, time TIMESTAMP,
TABLE-10
create table BOOKS( user_id int,ticket_id int,FOREIGN KEY(user_id)
TABLE-11
create table CANCEL(user_id int,ticket_id int ,passenger_id int,
INSERT QUERIES
INSERT INTO
USERS(user_id,first_name,last_name,adhar_no,gender,age,mobile_no,email,city,state,pincode,
password,security_ques,security_ans)
VALUES(1701, 'vijay','sharma',309887340843,'M',34,9887786655,
'vijay@gmail.com','vijayawada', 'andhrapradesh', 520001,'12345@#','favouritecolour', 'red');
INSERT INTO
USERS(user_id,first_name,last_name,adhar_no,gender,age,mobile_no,email,city,state,pincode,
password,security_ques,security_ans)
INSERT INTO
USERS(user_id,first_name,last_name,adhar_no,gender,age,mobile_no,email,city,state,pincode,
password,security_ques,security_ans)
VALUES(1703, 'manasvi','sree',765843210987,
'F',20,9995550666,'manasvi57@gmail.com','guntur','andhrapradesh',
522004,'0987hii','favourite flower','rose');
INSERT INTO
TRAIN(train_no,train_name,arrival_time,departure_time,availability_ofseats,date)
values(12711,'pinakiniexp','113000','114000','A',20170410),(12315,
cormandelexp','124500,125000', 'NA',20170410);
12 GROUP MEMBERS: KASHISH KHANDELWAL, NAINA NAUTIYAL, MISBA PARVEEN
INSERT INTO
INSERT INTO
INSERT INTO
PASSENGERS(passenger_id,pnr_no,age,gender,user_id,reservation
_status,seat_number,name,ticket_id) values(5001,78965,45,'M',1701,C,B6 45',
'ramesh',4001),(5002,54523,54,F,1701,W,B3-21','surekha,4002);
INSERT INTO
STARTS(train_no,station_no) values(12711,111),(12315,222),
INSERT INTO
STOPS_AT(train_no,station_no) values(12711,222),(12315,111);
INSERT INTO
REACHES(train_no,station_no,time) values(12711,222,040000'),(12315,111,053500');
INSERT INTO
INSERT INTO
where r.station_no=s.no;
5. Display details of all those users who cancelled tickets for train no------
select u.* from USERS u,cancel c,ticket t
order by date;
9. Display the train no which haults for more time in station no--------
select train_no from STATION
having max(hault);
10. Display details of all those passengers whose status is confirmed for train
no----
select t.* from TICKET t
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. These applications are already in progress and in
future they can be upgraded and may become part of amazing technology.