0% found this document useful (0 votes)
3 views22 pages

dbms-project-railway-reservation

The document outlines a DBMS project focused on a Railway Reservation System developed by students at Lovely Professional University. It includes an introduction, acknowledgment, declaration, and detailed sections on the system's design, entity relationship diagrams, SQL codes, and functionalities for booking and canceling train tickets. The project aims to automate the reservation process, reduce manual errors, and enhance customer convenience through a structured database management system.

Uploaded by

romagupta0743
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views22 pages

dbms-project-railway-reservation

The document outlines a DBMS project focused on a Railway Reservation System developed by students at Lovely Professional University. It includes an introduction, acknowledgment, declaration, and detailed sections on the system's design, entity relationship diagrams, SQL codes, and functionalities for booking and canceling train tickets. The project aims to automate the reservation process, reduce manual errors, and enhance customer convenience through a structured database management system.

Uploaded by

romagupta0743
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

lOMoARcPSD|52930462

DBMS Project Railway Reservation

Database Management Systems (Lovely Professional University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Anu Gupta (agupta1340@gmail.com)
lOMoARcPSD|52930462

RAILWAY REGISTRATION
SYSTEM

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING
By

Registration No. Name Roll No.


12105703 TEJASVI ARORA RK21PDA19
12100531 ROHIT KUMAR RK21PDA18
YADAV
12100224 Keshav Kumar Jha RK21PDA05

Under the guidance of


Ms. TAMINA THAKUR

School of Computer Science and Engineering


Lovely Professional University
Phagwara, Punjab (India)

Page | 1

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

ACKNOWLEDGMENT

Place : Lovely Professional University

Date : 8th November, 2022

We would like to thank ‘Ms. Tamina Thakur’ for assigning us with this project.
Through the project we are able to grasp more technical and have a hands-on practical
experience with projects. Through it we are able to learn how a project is created and
how necessary and crucial technical knowledge is. We are really grateful to the
faculty that has provided us with the necessary guidelines.

Name Registration No.

Tejasvi Arora 12105703

Rohit Kumar Yadav 12100531

Keshav Kumar Jha 12100224

Page | 2

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

DECLARATION STATEMENT

Place : Lovely Professional University

Date : 8th November, 2022

This is to declare that this report has been written by us. No part of the report is copied
from the other sources. All information included from other sources has been duly
acknowledged. We aver that if any part of the report is found to be copied, we will take
full responsibility for it.

Name : Tejasvi Arora

Reg. No. : 12105703

Signature :………………

Name : Rohit Kumar


Yadav
Reg. No. : 12100531

Signature :……………….

Name: Keshav Kumar Jha

Reg. No: 12100224

Signature :……………….

Page | 3

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

TABLE OF CONTENTS

CONTENTS PAGE NO.


1. INTRODUCTION ............................................................................ 1
2. ACKNOWLEDGEMENT ................................................................. 2
3. DECLARATION .................................................................................. 3
4. ABSTRACT ............................................................................................. 5
5. ENTITY RELATION DAIGRAM………………………………………7
6. LIST OF ENTITIES AND ATTRIBUTES……………………………...8
7. MAPPING TO ER DAIGRAMS…………………….…………………..10
8. SQL CODES………………………………………………………………12

Page | 4

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

ABSTRACT

The railway registration system facilitates the passengers to enquire about


the trains available based on source and destination, booking cancellation
of tickets, enquiry about the status of book tickets etc. The aim of the case
study is to design and develop a database maintaining the records of
different trains, train status, and passengers.

This project contains introduction to railways registration system. It is


computerized system of reserving the seats of train seats in advanced. It
is mainly used for long route. Online reservation has made the process for
reservation much easier than ever before.

In our country India there are number of counters for the reservation of
the seats and when can easily make reservation and get tickets. Then this
project contains Entity relationship model diagram based on railway
reservation and its reduction to the relation model. There is also a design
of database of the railway reservation system based on relation model. For
example, of some SQL queries to retrieves data from rail management
database.

Database is an organized Collection of data. The data is typically


organized to model aspect of reality in a way that supports process
requiring information. A DBMS makes it possible for the end users to
create, read, update and delete data in the database. The DBMS essentially
serves as an interface between database and users or application programs
insurance the data is consistently organized and remains easily assessable.
The DBMS managers three important things: the data, the database engine
that allows data to be assist and modified and the database schema, which
defines the data basis logical structure these three Foundation elements
help provide concurrency, security, data integrity and uniform
administration procedures. The DBMS cannot for both logical and
physical data Independence. it means it can product uses and applications
from netting to know where data is stored having to be concerned about
changes to the physical structure of data.

The main purpose of maintaining database for the railway registration


system is to reduce the manual errors involved in the booking and
cancellation of tickets and make it convenient for the customers and
providers to maintain the data about their customers and about the seats
available to at them. Due to automation many low poles that existed in the
manual maintenance of records can be removed. The speed of obtaining
processing the data will be fast.
Page | 5

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

For future expansion the proposed system can be web enabled so that the
clients can make various and queries about rains between stations. Due to
this, sometimes a lot of problems occur and they are facing many disputes
with customers. To solve the above problem, we designer database which
includes customer details availability future of seats in trains and number
of trains and their details.

This Project is about creating the database about Railway Reservation


system.

The railway registration 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 book ticket, etc. The
aim of case study is to design and developed a database maintaining the
records of different trains, train status, source, destination and passengers.
The record of train includes its number, name, source destination and days
on which it is available, where is record of train status includes for which
tickets can be the total number of seats available, and the number of seats
already booked.

Passengers can book their tickets for train in which seats are available. For
this with a passenger have two 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 is checked. Once the
train number and the booking data are validated, it is check whether a seat
is available or not. If yes, the ticket is booked which confirm status and
corresponding to get ID is generated with cheese sorted along with the
other details of the passenger. The ticket once book can be cancelled
anytime. For this, the passenger has to provide the ticket ID (the unique
key). The ticket ID is searched and corresponding row is deleted. With
this the first ticket with waiting status also get confirmed.

Page | 6

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

ENTITY RELATION DIAGRAM

Page | 7

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

LIST OF ENTITIES AND


ATTRIBUTES

ENTITIES ATTRIBUTES

USER_ID
First _Name
Last_ Name
Gender
USER Age
Email
Aadhar_ number
Mobile_ number
City
State
Pin code
password

Passenger_ ID
Name
Gender
Age
Pnr_ number
Passenger Seat_ number
Booked_ by
Reservation_ status

Train Number
Train_ name
Arrival_ Time
Train Departure_ Time
Availability_ of_ seats
Date1

Page | 8

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

No1
name
arrival_time
Station train_ no

id
user_id
Status
Ticket Number_ of_ passengers
Train no

User_id
Books Id

User_id
Cancel Id
Passenger_id

Page | 9

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

MAPPING TO ER DAIGRAM

User ID First Name Last Name Aadhar No Age Gender

Mobile No Email City State Pin code Password

PASSENGER
Passenger ID PNR No Age Gender User ID

TRAIN

Train Number Train Name Arrival Time Departure Time


Source Destination Availability Date

STATION

Number Name Arrival Time Source Destination Train Number

TICKET

ID User ID Status No of Train no


Passengers

CANCEL
User ID ID Passenger ID

BOOKS
User ID ID

STARTS
Train No Station No

REACHES
Train No Station No Time
Page | 10

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

STOPS AT
Train No Station No

Page | 11

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

3.ABOUT SQL

SQL is the standard language for dealing with Relational


Databases. SQL can be used to insert, search, update, and delete
database records. SQL can do lots of other operations, including
optimizing and maintenance of databases.
SQL stands for Structured Query language, pronounced as “S-
Q-L” or sometimes as “See-Quel

In our project we have first created Seven tables which consists


of User_id, Train, Station, Ticket, Passenger, Book, Cancel

CODE FOR THE CREATION OF TABLES

USER1:
create table user1( user_id numeric(2)
primary key,
first_name varchar(10),
last_name varchar(10),
adhar_no varchar(10),
gender varchar(1), age numeric(2), mobile_no numeric(10), email
varchar(30), city varchar(10), state varchar(10), pincode varchar(10),
password varchar(20));

TRAIN:
create table TRAIN( train_no varchar(10) primary key,
train_name varchar(20),
arrival_time time, departure_time time, availability_of_seats varchar(5),
date1 date);

STATION:
create table STATION( no1 numeric(3) , name varchar(20), arrival_time
time, train_no varchar(10), primary key(no1,train_no), foreign
Page | 12

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

key(train_no) references TRAIN(train_no));


TICKET:

create table TICKET( id varchar(10) primary key,user_id


numeric(2), status varchar(5), no_of_passengersint, 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) primary


key, pnr_no varchar(11), ageint, gender varchar(1), user_id
numeric(2), reservation_status varchar(5), seat_number
varchar(5), name varchar(20), ticket_id varchar(10), foreign key
(user_id) references user1(user_id), foreign key(ticket_id)
references TICKET(id))

BOOKS:

create table BOOKS( user_id numeric(2),

id varchar(10),

foreign key(user_id) references user1(user_id),

foreign key(id) references TICKET(id));

Page | 13

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

CANCEL:

create table CANCEL( user_id numeric(2), id varchar(10),


passenger_id varchar(10), foreign key(id) references
TICKET(id) , foreign key(passenger_id) references
PASSENGER(passenger_id), foreign key(user_id) references
user1(user_id));

Now, I have inserted values in all the tables.

Below is the code for the insertion of the values in the table;-

 CODE FOR THE CREATION OF TABLE :User_id

insert into user1


values('10','Rohit','Yadav','11111111','M','20','1111111111','rohit@gmail
.com','Radaur','Haryana','135001','mylife');
insert into user1
values('11','Mohit','Kumar','22222222','M','18','2222222222','mohit@gm
ail.com','Jaipur','Rajastan','302001','myway');
insert into user1
values('12','Sonu','Saini','33333333','M','25','3333333333','sonu@gmail.c
om','Bhopal','Mp','462001','sonulife');
insert into user1
values('13','Tejasvi','Arora','44444444','M','30','4444444444','tejasvi@g
mail.com','Indore','MP','452003','mytejasvi');
insert into user1
values('14','Keshav','Jha','55555555','M','60','5555555555','keshav@gmai
l.com','Bangalore','Karnataka','530068','mykeshav');
insert into user1
values('15','Govind','Singh','66666666','M','40','6666666666','Govind@g
mail.com','Surat','Gujarat','335009','mylife');
Page | 14

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

now the given value is inserted to the table for the view

now we use

Select * from User1;

It will display all the value that are inserted by us.

 CODE FOR THE CREATION OF TABLE: TRAIN

insert into TRAIN values('12346','HIMGIRI


Express','10:00:00','01:00:00','Yes','10-11-2022');
insert into TRAIN values('12347','LOHIT Express','10:00:00','01:00:00','Yes','10-
11-2022');
insert into TRAIN values('12348','CHENNAI
Express','23:00:00','09:00:00','Yes','11-11-2022');
insert into TRAIN values('12349','Bhopal Express','08:00:00','11:00:00','Yes','10-
11-2022');
insert into TRAIN values('12359','ABC Express','02:00:00','11:00:00','NO','10-
11-2022');
insert into TRAIN values('12351','BHARAT
Express','22:00:00','01:00:00','Yes','12-11-2022');

Now the value of train table will be inserted


To view this we use

Select * from Train;

It will display all the value that are inserted by us.


Page | 15

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

 CODE FOR THE CREATION OF TABLE: STATION

into STATION values('111','Nampally','17:00:00','12346');


insert into STATION values('222','Kanpur','07:00:00','12348');
insert into STATION values('333','Surat','23:00:00','12351');
insert into STATION values('444','Indore','03:00:00','12359');
insert into STATION values('555','Perambur','13:00:00','12349');
insert into STATION values('666','Pune','17:00:00','12345');
insert into STATION values('777','Amritsar','05:00:00','12347');

Page | 16

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

Here we have we have used

Select * from Station;

This will display all the inserted values of Station Table.

 CODE FOR THE CREATION OF TABLE: TICKET

insert into TICKET values('123123','15','RES','1','12345');


insert into TICKET values('234234','10','RES','2','12346');
insert into TICKET values('344345','10','RES','1','12346');
insert into TICKET values('456456','12','RES','1','12351');
insert into TICKET values('567567','13','WAT','1','12349');
insert into TICKET values('678678','14','RES','1','12359');
insert into TICKET values('789789','11','WAT','2','12348');
insert into TICKET values('890890','15','RES','1','12347'); Page | 17

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

insert into TICKET values('987987','13','RES','1','12359');


insert into TICKET values('876876','11','RES','1','12345');

Here we used ‘RES’ for reserved Ticket and WAT for the Waiting Ticket
Here we can use one User id for booking number of tickets as we can
user_id =10 booked more than one time.

Now we use
Select * from Ticket;
This will display all the value inserted by us

Page | 18

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

 CODE FOR THE CREATION OF TABLE: PASSENGER

Here we have used ‘NA’ for unreserved Tickets which is in the waiting list

Now we must use

Select * from Passenger;

By using this command now, we can view all the elements that we have
currently inserted

Page | 19

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

 CODE FOR THE CREATION OF TABLE: Books

insert into BOOKS values('15','123123');


insert into BOOKS values('10','234234');
insert into BOOKS values('10','344345');
insert into BOOKS values('12','456456');
insert into BOOKS values('13','567567');
insert into BOOKS values('14','678678');
insert into BOOKS values('11','789789');
insert into BOOKS values('15','890890');
insert into BOOKS values('11','876876');
insert into BOOKS values('13','987987');

OUTPUT:

We have used

Select * from Books;


This will display all the inserted elements in this table
Page | 20

Downloaded by Anu Gupta (agupta1340@gmail.com)


lOMoARcPSD|52930462

 CODE FOR THE CREATION OF TABLE: Cancel

insert into CANCEL values('10','344345','d5678');


insert into CANCEL values('11','789789','c3456');

OUTPUT:

We have used

Select * from Cancel;

This will display all the cancelled tickets

Page | 21

Downloaded by Anu Gupta (agupta1340@gmail.com)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy