Railway Management System Database Mini Project
Railway Management System Database Mini Project
XcadenGcYear I0f8-20f7
Ceccion - S3
Batch No: 6
We hereby declare thal this project based lab report entitled "RAILWAY
RESERVATION SYSTEM" hax been prepamd by us in partial fulfillment of the
requirement for the area »r data -BACHELOR OF TECtJNOt.OGY 1»
COMPUTER CCTENCE ENCINEERINC“ during the academic y¢ar 2016-
Wc also declare that iAis project bescd tab rcport is odour own ciTort and it
has not been submitted to any ott\cr univoaily for tote award of a‹ty degree.
Plnce: Vaddeswaram
acadamic Semester.
PROJECT ASSOCJATES
Student ID
Shashank Rrdd 150030407
T. Jai Sai Cliand 1 5003ß936
ACKNOWLEDGE\4Ei ITS .
£'ROJECT DESC’RIPTION.
In our counlry fnd ia, there are number oÏ' counters for the reservation of
lÏie seats and one can easily maLe reservetions and get ticLets. Then lhis project
conlains cnlity zetalionship model 4iagiam based on railway reservation systcm
Tttcrc is also dcsign of the dat8bcsc
of fhc railway res¢rvstion syefcm bescd on mlation mud¢l. Exampl¢ ofhome SÇL
qucries lo mlrieves óatc from mil maaagement daiabasc.
Database is sn organized collection of d‹tta. The detg is typically orgenizcd
\u modol aspects of reality in a way that supports proc<ss¢s requiring information.
A DBMS makes it possible for end users to create, ruad, update and delete data in a
database. The DBMS essentially serves as Bn interface between IJie database and
end users or application programs, ensuring ihal 4aia is coasist¢ntTy organized and
remains c8sily acccssiblc Tkc DBMS manages fhrec important things: thc date. the
database cnginc that altows data to bc accessed. locked and modified and the
database schema, wI\icfi defines lhe database’s 1ogical structure. Thae three
foundations I elemenls help provide concuzzency, security, dala integrily and
uniFonn administration pn›ccdurcs. The DBMS can offer both logical and physical
data indcpcndcnc¢ That mcans it csn protect users and applications from n¢¢ding
fa know whmro da\a is stored or taking \o be concerned about changes to the
physical slructuz¢ of data.
The main purpose of' maintaining database for Railway Reservation Syste T
is to reduce the manual errors involved in the booking and cancelling of wickets and
make it convenient for fhc customers sn4 provi4crr to maintain thc dala about tltcir
cu8tomcrs and also about \ftc seals available at \i\cm.Due \o automation many
loopholes that esist in the manual mainlmance oftI\e reconh can be removed. The
speed of obtaining and processing the data will be fast. For f\ifure expansion the
proposed system can be web enabled so ihat clicnu can make vBzious enquiries
Due to this. sometimes a Koi of problems occur and
fhcy are facing m›uty Jispu\cs witft customers. To solve fhc above problem, we
design a data base which includes customer details, availability of seats in trains,
no of frnins Bnd II\eir details
This p›cject i8 about cr¢ating \t\e daIaba&¢ aboul Railway Reservatio›t System.
The railway rcscrvalion system £ecilitetcs the pnss‹x gcrs to enquiry about
fhc trains svailablc on th¢ basis of source and dcetination, backing and ciinccl1ation
of tickets, enquizu about the status of the boo1ed ticket, etc. The aim of case stucly
is to design and develop a database maintaining the records of diJTerent tiains, bain
starus, and passengers. The record oF uain includes its number, nome, source,
dcstirrBtion, auld days on which it is available, whereas record oF train status
includes datas for which ‹ickcu can b¢ bookc‹L total number of seals ‹tvailsbTc, ard
number of scats already book¢d
Passcnj ers can book their úckets for the train in which scats are avaiJabtc.
For tltis, yzsscngcr has 1o yrovidc tfte dcsircd train numbcr and the da‹c for whictt
ficket is to be book¢d Befor¢ booking a tickct for a passcng¢r, fhc volidify oftmin
number and booking óate is chcckcd Once ttte Itain numbcr and booki‹tg date am
validated, it is checLed wI\ether the seat is avai1able. If' ygs, the ticket is booked
with confirm status and coriesponding ticket ID is generated which is slored along
with oth¢r detalls of rh¢ passcngcr. Th¢ tickct onc¢ bookcd can b¢ canccllcd et any
fimc. For this. th¢ passcngcr h8s to providc the tickct ID (the unique kcy). The
ficket fD is scorchod and \he corrssponding record is det¢ted. With fhis, fhe fi›st
tic1et witlt waitiI\g stalus a1so gels confirmcd.
2. Who booking is open only for next seven days from the current dale.
4. The total number ofticLets that can be booked in each category (AC nnd
Geneml) is 10.
5. The touil number of tickets lhat can be given ldc slatus of mailing is 2.
6, The in- between stoppage suitions and their book ings arc not considered,
read from the passenger. On the basis of” the values provided by the passenger,
corresponding record is retrieved from ihe Train Statns. JI the desired category is
AC, then total number of AC seats and number or booked AC sca‹s are compared
in order to finJ whether fickct can be buukc4 or not. Similarly, it cen be checked
for th¢ g¢n¢ral coi¢gory. TF fick¢t ccn bo book¢d. then passenger details am md
and slorcd in the f'assenger table. In Ihe cancellation procedure. ticket ID is mad
passen6er and corresponding record is searched in tfte Passenger. JI the
record exists, it is deleted. After deleting the record (if it is confinned), first record
with wailing status for the samc train and sgmc ca‹cgory are scorched from ‹he
Passenger iablc and its 6\a‹us is changed to confirm.
ENTITES ATTR IBUTES
Aødhat no
State
Security ques
S¢cuõ ty ans
Booked by
Reservation status
Train
B seersI
WScasl
W scełs3
BooLcó user
TRAI
id assen
BOOKS
RGACHEß
siaiion no
lesen user id
TRAIN
CANCEL
BOOKS
5TOfi8 AT
FINAL LIST OR RfiLATION SHIPS:
creale table i£ not exisfs STATION(no inl ,name varchart50),hau\t int,arrival time
time,train noint,prinuiry key(station no,train no),constarint f'oroign key(train no)
references TRAIN( trsin no));
create table if not exsi8ts TRAIN STATUS(tniin no int primuy Ley,b seats I
int,b seats2 int,a seats I int,a seats2 int,w soals I int,w seaTs2 in\,f'aIcI floa\,fare2
create table if not cxsi8ts STOf'S ATt train no int.station ri+ int,conslIaint I+reign
Ley(main no) references TItAfN(train no),constrain\ fbroign Loy(station no)
references STATION{no));
create t8blc if not cxsi8ts BOOKS( u or id int,id int.ccnstrcint forciym key(user id)
refewnces US£R(user id),conslraint foreign Let(id) references TICKET(id)).
!N5ERT QUERIES:
insert into
USER(uscr_id,first namc,lasf_nainc.8adftar no,gcndcr.agc.inobi\c no.cinail,city,st
atc,yincodc, aSsword,sccurity qucs,sccuñfy_ansJ
values( 1701.'vijay','sharma','309887340843','M',34,'9gS778ft655','vijay I jjmai1.co
m','vijayawada','andhrapradnh','Ji2000l','l234Ji #','fâvouritecolour','rcd’),(J702,'r
ohitft’.'kumar'.'45670987l234','M',4S,'98096GG535','rohithI kuma gmail.com’.'gu
ntur','andhrapradesh','522004’,'12@#34S','favountcbike’,'bn w'),( l703,'manasvi’,'sre
e','765b43210987’.'F',2t›,’9995550G66'.'nianasvi57 grnail.com’,’guntur','andhra
pmdesh','522004'.’0987hii’,'favourite fJower’,’rose’),
TRAIN STATUSt main no.w soat8 I.b coats I.b scats2,a scatsl,a scats2.w scats
2,farr1,fare2) values( 127a l. l0,4,O, l. I.0, l00,430),(I 23t5, l0,3.0,0,2,1,300,600),
insert into STOPS AT(train nu,station no) values(I 271 1 ,222j,( \ 23l5,T 11);
where t train no-m.train no and r.station not.no and s.name file 'vijayawada';
fi. ‹display details ofaTl fhosc us¢rs who canclcd wickets fbr train no-----
where t
order by date.
9. display the train no which hsulls for more time in station no--—-----
having max(hault);
10.display details of all those passengers whue status is confirmed for twin no