Project Report of Database
Project Report of Database
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.
Database Systems
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.......................................................................................................................5
CHAPTER 2: SYSTEM DESIGN..............................................................................................................6
2.1 DATA DICTIONARY.................................................................................................................6
2.2 ENTITY RELATIONSHIP DIAGRAM......................................................................................8
2.3 RELATIONAL MODEL.............................................................................................................9
CHAPTER 3: CODING............................................................................................................................10
3.1 SQL PORTION..........................................................................................................................10
3.2 MS ACCESS PORTION............................................................................................................15
CHAPTER 4:.............................................................................................................................................17
4.1 SNAP SHOTS................................................................................................................................17
4.2 REFERENCES...............................................................................................................................18
Database Systems
Project Report
TABLE OF FIGURES
Figure 1 DATA DICTIONARY...................................................................................................................7
Figure 2 ENTITY RELATIONSHIP DIAGRAM........................................................................................8
Figure 3 TABLE RELATIONAL DIAGRAM.............................................................................................9
Database Systems
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.
Database Systems
Project Report
Database Systems
Project Report
CHAPTER 2
SYSTEM DESIGN
2.1 Data Dictionary
Following are the tables along with their attributes and Meta data
Table Name
Column Name
Data Type\Size
P_ID
First Name
Last Name
Gender
Date of Birth
Mobile_N0
City
Null\Not
Null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Int
Varchar(40)
Varchar(60)
Varchar(40)
Datetime
bigint
Char(20)
Primary
Key
Yes
No
No
No
No
No
No
Foreign
Key
No
No
No
No
No
No
No
Passenger
Reservation
Reservation_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
TrainSchedul
e
T_S_ID
Not null
int
Yes
No
Train_ID
Arrival_Time
Departure_Time
T_Date
T_Day
Not null
Not null
Not null
Not null
Not null
int
Datetime
Datetime
Datetime
Varchar(30)
No
No
No
No
No
Yes
No
No
No
No
Route_ID
Destination_Statio
Not null
Not null
int
nvarchar(30)
Yes
No
No
No
Route
Database Systems
n
Fares
Project Report
Not null
money
No
No
Database Systems
Project Report
Gender
Full-name
Age
Mobile
City
P_ID
Passenger
DestinationStation
Source-Station
Has
Fares
Route
Route-ID
PNR
R_ID
Reservatio
n
PNR
Reservation
Date
Has
Reservation
Time
Has
Train-Name
Seat-Status
Seat-ID
Seat
Train
Schedule
Train-ID
Has
Train
Database Systems
Project Report
Database Systems
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,
FirstName varchar(40) not null,
LastName varchar(60) not null,
Gender varchar(40) not null,
DOB DateTime not null,
Mobile_No bigint not null,
City char(20) not null)
select * from Passenger
Insert into Passenger
values(1, 'Maryam','Mukhtiar','Female',31,0300-4321768,'KARACHI')
Insert into Passenger
values(2, 'Shaukat','Ali','Male',34,0314-4276490,'FAISLABAD')
Insert into Passenger
values(3, 'Madiha','Kiran','Female',26,0314-4276490,'ISLAMABAD')
Insert into Passenger
values(4, 'Abid','Aziz','Male',32,0315-3258043,'ATTOCK')
Insert into Passenger
values(5,'Zubia','Shahid','Female',28,0346-2428634,'PESHAWAR')
Insert into Passenger
values(6, 'Raheem','Ahmed','Male',45,0345-3276832,'MULTAN')
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 Reservation
values(1,1)
Insert into Reservation
26th December 2014
10
Database Systems
Project Report
values(2,2)
Insert into Reservation
values(3,3)
Insert into Reservation
values(4,4)
Insert into Reservation
values(5,5)
Insert into Reservation
values(6,6)
Insert into Reservation
values(7,7)
select * from Reservation
create table Reservation_Detail
(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 Reservation_Detail
Insert into Reservation_Detail
values(1,1,1,12/25/2014,'2:00:05')
Insert into Reservation_Detail
values(2,2,2,11/19/2014,'3:05:00')
Insert into Reservation_Detail
values(3,3,3,11/23/2014,'10:20:04')
Insert into Reservation_Detail
values(4,4,4,12/3/2014,'7:30:42')
Insert into Reservation_Detail
values(5,5,6,12/6/2014,'1:40:00')
Insert into Reservation_Detail
values(6,6,8,12/9/2014,'5:13:58')
Insert into Reservation_Detail
Values(7,6,9,12/14/2014,'11:00:36')
select * from Reservation_Detail
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)
26th December 2014
11
Database Systems
Project Report
12
Database Systems
Project Report
13
Database Systems
Project Report
14
Database Systems
Project Report
15
Database Systems
Project Report
Query 4:
SELECT Train.[Train Name], [Train Schedule].[Arrival Time], [Train Schedule].
[Departure Time], [Train Schedule].Date, [Train Schedule].Day, Route.[Source
Station], Route.[Destination Station], Route.Fares
FROM Route INNER JOIN (Train INNER JOIN [Train Schedule] ON Train.Train_ID=[Train
Schedule].Train_ID) ON Route.[Route ID]=Train.Route_ID
WHERE (((Route.[Source Station])="KARACHI")) OR (((Route.[Source
Station])="LAHORE"));
Query 5:
SELECT Route.[Route ID], Route.[Source Station], Route.[Destination Station],
Route.Fares
FROM Route
WHERE (((Route.Fares)=1400));
16
Database Systems
Project Report
CHAPTER 4
4.1 Snap Shots
Home Page
Form Page
17
Database Systems
Project Report
Ticket Slip
4.2 References
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
%2520%25282%2529.doc&ei=kbGbVKSYCZOfugT6o4DYCQ&usg=AFQjCNEVO
ajMWUg6Ufa36mFTtffkRhl9Zw&bvm=bv.82001339,d.c2E
18
Database Systems
Project Report
The reference is also taken from lectures of Database Systems and Lab work.
19