Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
63 views

Project Report of Database

The document is a project report for a database systems course. It includes an acknowledgements section thanking those who provided guidance and support for the project. It outlines the project aims of designing an online railway reservation system to automate ticket reservation and back office activities. It presents the entity relationship diagram and relational model describing the tables and relationships between passenger, reservation, seat, train, route and other tables. It also includes the SQL code for creating some of the tables and inserting sample data.

Uploaded by

api-307821649
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Project Report of Database

The document is a project report for a database systems course. It includes an acknowledgements section thanking those who provided guidance and support for the project. It outlines the project aims of designing an online railway reservation system to automate ticket reservation and back office activities. It presents the entity relationship diagram and relational model describing the tables and relationships between passenger, reservation, seat, train, route and other tables. It also includes the SQL code for creating some of the tables and inserting sample data.

Uploaded by

api-307821649
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Database Systems

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.

26th December 2014

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

26th December 2014

Database Systems

Project Report

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

26th December 2014

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.

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.

26th December 2014

Database Systems

Project Report

1.3 Project Scope


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.

26th December 2014

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

26th December 2014

Database Systems
n
Fares

Project Report

Not null

money

No

No

Figure 1: Data Dictionary

26th December 2014

Database Systems

Project Report

2.2 Entity Relationship Model (ERD)

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

Figure 2: Entity Relationship Diagram

26th December 2014

Database Systems

Project Report

2.3 Relational Model

Figure 2: Table Relational Diagram

26th December 2014

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

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')
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')
26th December 2014

12

Database Systems

Project Report

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
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
26th December 2014

13

Database Systems

Project Report

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

26th December 2014

14

Database Systems

Project Report

3.2 Ms Access Portion


Join Queries
Ticket Query:
SELECT Passenger.[First Name], Passenger.[Last Name], Passenger.Gender,
Reservation.[Reservation ID], R_Details.PNR, Seat.Seat_ID, Train.[Train Name], [Train
Schedule].[Arrival Time], [Train Schedule].Date, Route.[Source Station], Route.
[Destination Station], Route.Fares
FROM ((Passenger INNER JOIN Reservation ON Passenger.P_ID = Reservation.
[Reservation ID]) INNER JOIN ((Route INNER JOIN Train ON Route.[Route ID] =
Train.Route_ID) INNER JOIN (Seat INNER JOIN R_Details ON Seat.Seat_ID = R_Details.
[Seat ID]) ON Train.Train_ID = Seat.[Train ID]) ON Reservation.PNR = R_Details.PNR)
INNER JOIN [Train Schedule] ON Train.Train_ID = [Train Schedule].Train_ID
WHERE (((Reservation.[Reservation ID])=[ENTER Reservation ID]));
Query 1:
SELECT Passenger.[First Name], Passenger.[Last Name], Passenger.Gender,
Passenger.DOB, Year(Now())-Year([DOB]) AS Age
FROM Passenger;
Query 2:
SELECT Passenger.[First Name], Passenger.[Last Name], Passenger.Gender, Reservation.PNR,
R_Details.[Seat ID], Seat.[Train ID], Seat.[Seat Status]
FROM (Passenger INNER JOIN Reservation ON Passenger.P_ID = Reservation.[Reservation ID])
INNER JOIN (Seat INNER JOIN R_Details ON Seat.Seat_ID = R_Details.[Seat ID]) ON
Reservation.PNR = R_Details.PNR;
Query 3:
SELECT Seat.Seat_ID, Train.Train_ID, Route.[Route ID], Seat.[Seat Status]
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"));

26th December 2014

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));

26th December 2014

16

Database Systems

Project Report

CHAPTER 4
4.1 Snap Shots
Home Page

Form Page

26th December 2014

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

26th December 2014

18

Database Systems

Project Report

The reference is also taken from lectures of Database Systems and Lab work.

26th December 2014

19

You might also like