Sei sulla pagina 1di 19

Database System

Project Report

ACKNOWLEDGEMENT
We take this opportunity to present our votes of thanks to all those who guide us and acted as lightening
pillars to enlighten our way throughout this project that has led to successful and satisfactory completion
of this study.
We are really grateful to our subject teacher Miss Samia Ghazala for providing us with an opportunity to
undertake this project in this university and providing us with all the facilities and knowledge. We are
highly thankful for her active support, valuable time and advice, whole-hearted guidance, sincere
cooperation and involvement during the study and in completing the preparation of our project within the
time stipulated.
Lastly, We are thankful to all those, particularly the various friends , who have been instrumental in
creating proper, healthy and conductive environment and including new and fresh innovative ideas for us
during the project, their help, it would have been extremely difficult for us to prepare the project in a time
bound framework.
Thank You.

th

26 December 2014

Database System

Project Report

TABLE OF CONTENTS

ACKNOWLEDGEMENT...........................................................................................................................1
TABLE OF CONTENTS.............................................................................................................................1
TABLE OF FIGURES.................................................................................................................................3
CHAPTER 1: INTRODUCTION................................................................................................................4
1.1 PROJECT OVERVIEW..............................................................................................................4
1.2 AIMS AND OBJECTIVES..........................................................................................................4
1.3 PROJECT SCOPE.......................................................................................................................4
CHAPTER 2: SYSTEM DESIGN..............................................................................................................5
2.1 DATA DICTIONARY.................................................................................................................6
2.2 ENTITY RELATIONSHIP DIAGRAM......................................................................................8
2.3 RELATIONAL MODEL.............................................................................................................9
CHAPTER 3: CODING..............................................................................................................................9
3.1 SQL PORTION..........................................................................................................................10
3.2 MS ACCESS PORTION............................................................................................................15
CHAPTER 4..............................................................................................................................................17
4.1 SNAP SHOTS................................................................................................................................17
4.2 REFERENCES...............................................................................................................................19

th

26 December 2014

Database System

Project Report

TABLE OF FIGURES
Figure 1 DATA DICTIONARY...................................................................................................................6
Figure 2 ENTITY RELATIONSHIP DIAGRAM........................................................................................8
Figure 3 TABLE RELATIONAL DIAGRAM.............................................................................................9

th

26 December 2014

Database System

Project Report

CHAPTER 1
INTRODUCTION
1.1 Project Overview
This project will help in solving all the problems in existing system of Railway Reservation System. In
existing system all data is stored in files which is awkward method and many problems are faced by the
users and passengers, so this project will help to enter data easily in computer database then no problems
will be faced by the users and passengers. The user can easily find any data at any time in a few seconds.
It includes modules required to successfully operate railway reversion process smoothly. It has train
master to add modify train information, Train schedule to enter train schedule details include all the
source and destination station names, arrival time and departure time. It includes automatic fare
calculation as per the distance between two stations. Reservation modules consist of automatic seat no
and train no allocation system. Daily scheduling and updating of not available seats in train can be done
easily. All master like train master, train schedule, reservation fees, can be modified individually from
front end and changes reflect in all modules immediate. Therefore proposed Online Railway Reservation
System has been designed to automate the process of railway for ticket reservation and back office
activities. System can make the daily activities efficient and providing the fast response.
Saves Time and Effort
You can save the time needed to travel to the railway reservation office and waiting
in the queue for your turn.

1.2 Aims and Objectives


Our project introduces Railway Reservation System with an objective to make the
reservation system more efficient, easier and fast. This project explores how
computer technology can be used to solve the problem of user. The main objectives
provided by this software are as follows:
We can enquire about availability of trains
We can reserve seats anytime
We can modify the information related to Trains, Time Table, Train Name, Train
Number, and Ticket Fares.
This project is dedicated to model existing Railway Reservation Systems that Aim at
development of Railway Reservation System that facilitates the railway customer to
manage their reservation and the railway administrator to modify the backend
database in a user-friendly manner.

1.3 Project Scope

th

26 December 2014

Database System

Project Report

The scope of our project is to solve all existing problems in Railway Reservation
System. Pakistan has some of the most spectacular and unforgettable rail journeys
in the world. Here you experience a simple way. There's no better way to enjoy
Pakistan's outback, cities, coastal towns and regional areas in comfort. An
advantage of this DBMS is that DBMS allows large amounts of data to be stored in
the most efficient manner. The data is stored in lists of independent information.
Additional data sets can be added at any time. Relationships between the data sets
are defined in the DBMS, and can be altered without affecting the data.

th

26 December 2014

Database System

Project Report

CHAPTER 2
SYSTEM DESIGN
2.1 Data Dictionary
Following are the tables along with their attributes and Meta data
Table name
Passenger

Column name
PNR
Email_ID
Password
First Name
Last Name
Gender
Age
Mobile_N0
City
Security_Question
Security_Answer

Null\not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
null
null

Data type\size
Int
nvarchar(40)
nvarchar(20)
Varchar(40)
Varchar(60)
Varchar(40)
int
bigint
Char(20)
nvarchar(60)
nvarchar(80)

Primary key
Yes
No
No
No
No
No
No
No
No
No
No

Foreign key
No
No
No
No
No
No
No
No
No
No
No

Reservation

R_ID
PNR

Not null
Not null

int
int

Yes
No

No
Yes

Has

P_S ID
PNR
Seat_ID
Reservation_Date
Reservation_Time

Not null
Not null
Not null
Not null
Not null

int
int
int
Datetime
Datetime

Yes
No
No
No
No

No
Yes
Yes
No
No

Seat

Seat_ID
Train_ID
Seat_Status

Not null
Not null
Not null

int
int
nvarchar(40)

Yes
No
No

No
Yes
No

Train

Train_ID
Route_ID
Train_Name

Not null
Not null
Not null

int
int
Char(20)

Yes
No
No

No
Yes
No

TrainSchedule

T_S_ID
Train_ID
Arrival_Time
Departure_Time
T_Date
T_Day

Not null
Not null
Not null
Not null
Not null
Not null

int
int
Datetime
Datetime
Datetime
Varchar(30)

Yes
No
No
No
No
No

No
Yes
No
No
No
No

Route

Route_ID
Source_Station

Not null
Not null

int
nvarchar(30)

Yes
No

No
No

th

26 December 2014

Database System

Project Report

Destination_Station
Fares

Not null
Not null

nvarchar(30)
money

No
No

No
No

Figure 1: Data Dictionary

th

26 December 2014

Database System

Project Report

2.3 Relational Model

Figure 2: Table Relational Diagram

th

26 December 2014

Database System

Project Report

CHAPTER 3
CODING
3.1 SQL Portion
Create database Railway_Reservation_System
create table Passenger
(PNR int not null constraint pik_id primary key,
Email_ID nvarchar(40) not null,
Passwrd nvarchar(20) not null,
FirstName varchar(40) not null,
LastName varchar(60) not null,
Gender varchar(40) not null,
Age int not null,
Mobile_No bigint not null,
City char(20) not null,
Sequrity_Question nvarchar(60) null,
Security_Answer nvarchar(80) null)
select * from Passenger
Insert into Passenger
values(1,'maryammukhtiar@yahoo.com','*****','Maryam','Mukhtiar','Femal
e',31,0300-4321768,'KARACHI','what is your favourite place?','Faisal
masjid')
Insert into Passenger
values(2,'shaukat_ali88@live.com','********','Shaukat','Ali','Male',34
,0314-4276490,'FAISLABAD','what is your fvaourite colour?','Purple')
Insert into Passenger
values(3,'madihakiran@hotmail.com','******','Madiha','Kiran','Female',
26,0314-4276490,'ISLAMABAD','what is your favourite ride?','Roller
coaster')
Insert into Passenger
values(4,'abidaziz@gmail.com','*******','Abid','Aziz','Male',32,03153258043,'ATTOCK','what is your favourite country?','America')
Insert into Passenger
values(5,'zubiashahid@live.com','******','Zubia','Shahid','Female',28,
0346-2428634,'PESHAWAR','what is your favourite company?','Axact')
Insert into Passenger
values(6,'raheemahmed@yahoo.com','****','Raheem','Ahmed','Male',45,034
5-3276832,'MULTAN','what is your favourite city?','Islamabad')
th

26 December 2014

Database System

Project Report

select * from Passenger


create table Reservation
(R_ID int not null constraint pyk_id primary key,
PNR int not null constraint fyk_id foreign key
references Passenger(PNR))
select * from Reservation
Insert into
values(1,1)
Insert into
values(2,2)
Insert into
values(3,3)
Insert into
values(4,4)
Insert into
values(5,5)
Insert into
values(6,6)
Insert into
values(7,7)

Reservation
Reservation
Reservation
Reservation
Reservation
Reservation
Reservation

select * from Reservation


create table Has
(P_S_ID int not null constraint pks_id primary key,
PNR int not null constraint fks_id foreign key
references Passenger(PNR),
Seat_ID int not null constraint fbp_id foreign key
references Seat(Seat_ID),
Reservation_Date datetime not null,
Reservation_Time datetime not null)
select * from Has
Insert into Has
values(1,1,1,12/25/2014,'2:00:05')
Insert into Has
values(2,2,2,11/19/2014,'3:05:00')
Insert into Has
values(3,3,3,11/23/2014,'10:20:04')
Insert into Has
values(4,4,4,12/3/2014,'7:30:42')
Insert into Has
th

26 December 2014

10

Database System

Project Report

values(5,5,6,12/6/2014,'1:40:00')
Insert into Has
values(6,6,8,12/9/2014,'5:13:58')
Insert into Has
Values(7,6,9,12/14/2014,'11:00:36')
select * from Has
create table Seat
(Seat_ID int not null constraint pky_id primary key,
Train_ID int not null constraint fky_id foreign key
references Train(Train_ID),
Seat_Status nvarchar(40) not null)
select * from Seat
Insert into Seat
values(1,1,'AVAILABLE')
Insert into Seat
values(2,1,'AVAILABLE')
Insert into Seat
values(3,2,'AVAILABLE')
Insert into Seat
values(4,4,'AVAILABLE')
Insert into Seat
values(5,2,'NOT AVAILABLE')
Insert into Seat
values(6,3,'AVAILABLE')
Insert into Seat
values(7,3,'AVAILABLE')
Insert into Seat
values(8,8,'AVAILABLE')
Insert into Seat
values(9,4,'AVAILABLE')
Insert into Seat
values(10,5,'AVAILABLE')
Insert into Seat
values(11,5,'AVAILABLE')
Insert into Seat
values(12,6,'AVAILABLE')
Insert into Seat
values(12,6,'AVAILABLE')
Insert into Seat
values(14,6,'NOT AVAILABLE')
Insert into Seat
values(15,7,'AVAILABLE')
th

26 December 2014

11

Database System

Project Report

select * from seat


create table Train
(Train_ID int not null constraint pk_id primary key,
Route_ID int not null constraint fk_id foreign key
references Route(Route_ID),
Train_Name char(20)not null)
select * from Train
Insert into Train
values(1,1,'Awam Express')
Insert into Train
values(2,2,'Karachi Express')
Insert into Train
values(3,3,'Bolan Mail')
Insert into Train
values(4,3,'Pakistan Express')
Insert into Train
values(5,5,'Faisal Express')
Insert into Train
values(6,6,'Karakarom Express')
Insert into Train
values(7,7,'Fareed Express')
Insert into Train
values(8,8,'Millat Express')
Select * from Train
create table TrainSchedule
(T_S_ID int not null constraint prk_id primary key,
Train_ID int not null constraint frk_id foreign key
references Train(Train_ID),
Arrival_Time datetime not null,
Departure_Time datetime not null,
T_Date Datetime not null,
T_Day varchar(30) not null)
select * from TrainSchedule
Insert into TrainSchedule
values(1,1,'1:00:00','1:30:00',12/13/2014,'MONDAY')
Insert into TrainSchedule
values(2,2,'3:00:00','3:30:00',12/14/2014,'TUESDAY')
Insert into TrainSchedule
values(3,3,'5:00:00','5:30:00',12/15/2014,'WEDNESDAY')
Insert into TrainSchedule
th

26 December 2014

12

Database System

Project Report

values(4,4,'7:00:00','7:30:00',12/16/2014,'THURSDAY')
Insert into TrainSchedule
values(5,5,'9:00:00','9:30:00',12/17/2014,'FRIDAY')
Insert into TrainSchedule
values(6,6,'11:00:00','11:30:00',12/18/2014,'SATURDAY')
Insert into TrainSchedule
values(7,7,'2:00:00','2:30:00',12/19/2014,'SUNDAY')
Insert into TrainSchedule
values(8,8,'4:00:00','4:30:00',12/20/2014,'MONDAY')
select*from TrainSchedule
Create table Route
(Route_ID int not null constraint pkr_id primary key,
Source_Station nvarchar(30) not null,
Destination_Station nvarchar(30) not null,
Fares money not null)
select * from Route
Insert into Route
values(1,'KARACHI','MULTAN',1500.00)
Insert into Route
values(2,'KARACHI','LAHORE',1400.00)
Insert into Route
values(3,'LAHORE','PESHAWAR',1600.00)
Insert into Route
values(4,'LAHORE','FAISLABAD',1400.00)
Insert into Route
values(5,'PESHAWAR','MULTAN',1800.00)
Insert into Route
values(6,'MULTAN','KARACHI',1700.00)
Insert into Route
values(7,'FAISLABAD','ATTOCK',1350.00)
Insert into Route
values(8,'ATTOCK','LAHORE',1200.00)
Insert into Route
values(9,'QUETTA','KARACHI',1900.00)
select * from Route

th

26 December 2014

13

Database System

Project Report

3.2 Ms Access Portion


Join Queries
Passenger Query:
SELECT Passenger.PNR, Reservation.PNR, Seat.Seat_ID, Train.[Train Name],
Seat.Seat_ID, [Train Schedule].[Arrival Time], [Train Schedule].Date, [Train
Schedule].Day, Route.[Source Station], Route.[Destination Station], Route.Fares
FROM ((Route INNER JOIN Train ON Route.[Route ID]=Train.Route_ID) INNER JOIN
((Seat INNER JOIN (Passenger INNER JOIN Has ON Passenger.PNR=Has.PNR) ON
Seat.Seat_ID=Has.[Seat ID]) INNER JOIN Reservation ON
(Passenger.PNR=Reservation.PNR) AND (Reservation.Reservation_ID=Has.PNR)) ON
Train.Train_ID=Seat.Train_ID) INNER JOIN [Train Schedule] ON Train.Train_ID=[Train
Schedule].Train_ID
WHERE (((Reservation.PNR) = [Enter PNR :]));
Query 1:
SELECT Reservation.Reservation_ID, Has.PNR, Seat.Seat_ID, Seat.[Seat Status]
FROM Reservation INNER JOIN (Seat INNER JOIN Has ON Seat.Seat_ID=Has.[Seat ID])
ON Reservation.Reservation_ID=Has.PNR;
SELECT Passenger.PNR, Passenger.[First Name], Passenger.[Last Name], Reservation.Reservation_ID,
Has.[Seat ID], Seat.Train_ID, Train.[Train Name]
FROM Train INNER JOIN ((Seat INNER JOIN (Passenger INNER JOIN Has ON Passenger.PNR =
Has.PNR) ON Seat.Seat_ID = Has.[Seat ID]) INNER JOIN Reservation ON
(Reservation.Reservation_ID = Has.PNR) AND (Passenger.PNR = Reservation.PNR)) ON
Train.Train_ID = Seat.Train_ID;
Query 2:
SELECT Passenger.PNR, Passenger.[First Name], Passenger.[Last Name], Reservation.Reservation_ID,
Has.[Seat ID], Seat.Train_ID, Train.[Train Name]
FROM Train INNER JOIN ((Seat INNER JOIN (Passenger INNER JOIN Has ON Passenger.PNR =
Has.PNR) ON Seat.Seat_ID = Has.[Seat ID]) INNER JOIN Reservation ON
(Reservation.Reservation_ID = Has.PNR) AND (Passenger.PNR = Reservation.PNR)) ON
Train.Train_ID = Seat.Train_ID;
Query 3:
SELECT Seat.Seat_ID, Train.Train_ID, Train.[Train Name], [Train Schedule].[Arrival
Time], [Train Schedule].[Departure Time], [Train Schedule].Date, [Train
Schedule].Day

th

26 December 2014

14

Database System

Project Report

FROM (Train INNER JOIN Seat ON Train.Train_ID=Seat.Train_ID) INNER JOIN [Train


Schedule] ON Train.Train_ID=[Train Schedule].Train_ID;
Query 4:
SELECT Seat.Seat_ID, Seat.[Seat Status], Train.[Train Name], Route.[Source Station], Route.
[Destination Station], Route.Fares
FROM Route INNER JOIN (Train INNER JOIN Seat ON Train.Train_ID=Seat.Train_ID) ON Route.
[Route ID]=Train.Route_ID
WHERE ((Not (Seat.[Seat Status])="AVAILABLE"));
Query 5:
SELECT Seat.Seat_ID, Seat.[Seat Status], Train.[Train Name], Route.[Source Station], Route.
[Destination Station], Route.Fares
FROM Route INNER JOIN (Train INNER JOIN Seat ON Train.Train_ID=Seat.Train_ID) ON Route.
[Route ID]=Train.Route_ID
WHERE (((Seat.[Seat Status])="AVAILABLE"));

th

26 December 2014

15

Database System

Project Report

CHAPTER 4
Snap Shots
Home Page

Form Page

th

26 December 2014

16

Database System

Project Report
Passenger Query Form for Ticket Slip

Ticket Query

th

26 December 2014

17

Database System

Project Report
Ticket Slip

References

th

http://onlinestudyarea.blogspot.com/2012/11/online-railway-reservationsystem.html
http://www.scribd.com/doc/100203820/Railway-Reservation-ProjectReport#scribd
http://www.muengineers.in/computer-project-list/java-projects-list/railwayreservation-system
http://seminarprojects.com/Thread-railway-reservation-system-full-report
http://download.intel.com/education/easysteps/makeonlinerailwayreservation
s.pdf
http://www.google.com.pk/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=11&cad=rja&uact=8&ved=0CEcQ
FjAK&url=http%3A%2F%2Ffree4ebook.com%2Frailway

26 December 2014

18

Database System

Project Report

%2520%25282%2529.doc&ei=kbGbVKSYCZOfugT6o4DYCQ&usg=AFQjCNEVO
ajMWUg6Ufa36mFTtffkRhl9Zw&bvm=bv.82001339,d.c2E
The reference is also taken from lectures of Database Systems and Lab work.

th

26 December 2014

19

Potrebbero piacerti anche