Sunteți pe pagina 1din 14

Term Paper OF DBMS

Topic: Railway reservation


system for Indian railways.
SUBMITT D TO Manal Tane"a Sa$%re SUBMITT D B! S#mmit &'()*+( +('(),&,

ACKNOWLEDGEMENT

I Summit Sakhre feel great pleasure in submitting this project as the culmination of my guides efforts. This project required hard work; sincerity and devotion that I tried my best to put in this project and in turn gained a lot of knowledge from this project.
I am deeply grateful to my teacher who has helped me in completion of this project. She has been a constant guiding force and source of illumination for me. I would like to thank her for her valuable advice and guidance. I am also thankful to my friends who helped me in this project. project. !t last but not least" I am thankful to the almighty god with whose grace I was always motivated and able to complete the project and ith their combine efforts I complete this

Summit Sakhre

CONTENTS S NO.
# * I$T%&'()TI&$ +$TIT, %+-!TI&$S.I/ 'I!0%!1S *.# 4 +% 'I!0%!1 2&% %!I- !, %+S+%3!TI&$ S,ST+1

TOPIC

%+-!TI&$!- 1&'+4.# 4.* 4.4 4.6 4.7 T!5-+ 2&% T%!I$ T!5-+ 2&% )(ST&1+% T!5-+ 2&% %+S+%3!TI&$ )!$)+--!TI&$ &2 %+S+%3!TI&$ 8(+%I+S

6 7

!'3!$T!0+S &2 %!I- !, %+S+%3!TI&$ S,ST+1 S&%)+ )&'+

ABSTRACT
This term contains Introduction to the %ailways reservation system .It is the computeri9ed system of reserving the seats of train seats in advanced . It is mainly used for long root . &n:line reservation has made the process for the reservation of seats very much easier than ever before.

In our country India" there are number of counters for the reservation of the seats and one can easily make reservations and get tickets. Then this term paper contain entity relationship model diagram based on rail reservation system and introduction to relation model .There is also design of the database of the rail reservation system based on relation model. %elation model has three relation %!I-;'+T!I-S " );'+T!I-S and %+S+%3!TI&$. +<ample of some S8- queries to retrieves data from rail management database.

RAILWAY MANAGEMENT SYSTEM

the computeri9ed system of reserving the seats of train seats in advanced . It is mainly used for long root . &n:line reservation has made the process for the reservation of seats very much easier than ever before. In our country India" there are number of counters for the reservation of the seats and one can easily make reservations and get tickets. !lmost all of the manual reservations centres have been converted into computeri9ed reservation centers" which provide booking and

=: railway management System is

reservation of the ticket facilities from one station to another. This system is very helpful and it is very easy to operate on it. It allows advanced booking. )omputeri9ation system has also made it possible for passengers to book their tickets online and it has also allowed for the checking whether the tickets in waiting list are confirmed or not. It also provides the information regarding fares and timings of the train. !n emergency reservation scheme has also been provided by this computeri9ed system. In the train reservation system for a state transport we should have all the details of cities" villages etc to design the database of this system. 2or this system we have to design the database which have all the information about trains their timing" origin" destination" %oots" Total no. of seats in a particular train. Type of train and the full detail of the passenger for e<ample passenger id " passenger name" phone number" address" seats the passenger wants to reserve etc.

Represention of Train Reservation System for a state transportation with the help of EntityRelationship Diagram and Relational Model. E-R Diagram :This is an Entity-Relationship diagram of Train Reservation System

/h;$ &.
-.ID

-/0a mee

*dd *1e

Destinati on Ori1i n Reserv es

Total/se ats T/typ e T/no TRA

CUSTOM ER Se2 State -I D R/Da te

IN

*rrivalti mee D/tim e

RESERVA TION Seats /res B0 O/

Rentperse at Receipt/ no

In this diagram )(ST&1+% " T%!I$ and %+S+%3!TI&$ are entities and the relationship between them is reserves.

Passenger entit has se!en attri"utes =: );$o" /h;$o " );$ame" !dd" !ge"Se<"State
which defines customer number" phone number" customer name" address" age "se< and State of customer.

Train entit

has eight attri"utes =: &rigin" 'estination" T;seats" " T;type " T;no

"T;Timing mean departure time and arrival time of the train. 2air>perseat which defines origin of train" destination of train" total no. of seats in a train" train type and train number"timing of train"fair of reservation for per seat.

RESER#ATION re$ati%n has &i!e attri"ute=:

%;'ate "Seats;reserved")I'" %eceipt;$o"5$&. which defines reservation date " number of seats reserved by passenger"passenger id" %eceipt no. given to the customer" train number.

RELATIONAL MODEL'( train( Detai$s Ta"$e '


2irstly" we create a table using )%+!T+ query. 'ifferent attributes are defined with data types. .ere T;$& is a primary key.

Then we insert values of all the attributes into this table using INSERT S)L query

Select query is used to retrieve data from the relation.

/rimary ?ey
T;Type !.) general 0eneral SI T;$o /5*@@A &rigin 'estination T;S+!TS B@ C@ A7 B7 'eparture !rriva Time l Time Bpm #*am 7am *pm #@am #@pm Aam #am 2air>perseat 7@@ 7@@ *7@ 4@@

chandigar amritsar h /5*46A chandigarh bhatinda /5*@#@ pathancoat jalandhar /5*@@@ -udhiana navaseher

Re$ati%n name* train+Detai$s is ,reate* -hi,h st%res the in&%rmati%n a"%ut train.

*D C(Detai$s Ta"$e' This table give the all the details of the passenger. in this table );I' is the primary key so that there is no duplicacy of the passenger . e have to create another table passenger using )%+!T+ query

To retrieve the passenger table we again apply Select statement.

/rimary key

);I'. #@ # #@ * #@ 4 #@ 6

);$ame !shish

!ge * @ * # * # * #

!ddr 0andhi nagar gujarat /ilibhit bareilly /ilibhit bareilly 1aulot punjab

/h;$o EE4C*7A*EC BA#64**#*@ AECA4A6BAE EABC77@C@6

Se< male 1ale 1ale emale

State gujarat (tter /radesh (tter /radesh /unjab

3inod Sanjeev Tushar

Reser!ati%n Ta"$e'(
This table give details about the reservation of train

RESER#ATION ta"$e retri!e* " se$e,t statement.

2oreign ?ey 5$o /5*@@@ /5*@#@ /5*46A /5*@@A %;'ate @A:'+): #@ @E:'+): #@ #@:'+): #@ 4#:'+): #@ Seats;reserved # * 4 6 )I' #@# #@* #@4 #@6 %eceipt; $o #@#@# #@#@* #@#@4 #@#@6

%elation named %+S+%3!TI&$ is created which stores the information about reservation of train In this relation T;$o act as a foreign key references from train;details.

)ancelation of TI)?+T or %eaervation=: If any passanger wants the cancelation of his tickets or reservation then the deletion of this particular reservation record from database is done using '+-+T+ S8- query.

. S.&

)!$)-+' TI)?+T

S&(%)+ )&'+
#.create table rail;detailsF%;type varchar*F#@D" 5;$o varchar*F*@D/rimary ?ey" origin varchar*F#7D" details varchar*F*@D" total;seats numberF#@D" dept;time varchar*F*@D" arr;time varchar*F*@D" fairperseat numberF*@DD;

*.insert into rail;details valuesFGSlG" Gpb*@@@G" G-udhianaG" GnavaseherG" B7" G#@pmG"G#amG" 4@@D;

4.create table c;detailsFc;id numberF*@Dprimary key" c;name varchar*F*@D" age numberF*@D" addr varchar*F4@D" ph;no numberF##D" se< varchar*FBD" state varcharF*@DD;

6.insert into c;details valuesFG#@#G" G!shishG" G*@G" Ggandhi nagar gujratG" GEE4C*7A*ECG" G1aleG" G0ujratGD; insert into c;details valuesFG#@*G" G3inodG" G*#G" G/ilibhit bareillyG" GBA#64**#*@G" G1aleG" G(ttar /radeshGD; insert into c;details valuesFG#@4G" GSanjeevG" G*#G" G/ilibhit bareillyG" GAECA4A6BAEG" G1aleG" G(ttar /radeshGD; insert into c;details valuesFG#@6G" GTusharG" G*#G" G1alout /unjabG" GEABC77@C@6G" G1aleG" G/unjabGD; insert into c;details valuesFG#@7G" GSummitG" G*#G" G'.-. . 3aranasiG" GAECA4A6BEAG" G1aleG" G(ttar /radeshD;

7.create table %+S+%3!TI&$ F5$& varchar*F4@D" %;'ate date" Seats;%eserved numberF*@D" )I' numberF#@D" receipt;no numberF#@D" foreign key F5$&D references rail;detailsF5;noD D;

C.insert into %+S+%3!TI&$ valuesFGpb*@@@G" G@A:'+):#@G" G#G" G#@#G" G#@#@#GD; insert into %+S+%3!TI&$ valuesFGpb*@#@G" G@E:'+):#@G" G*G" G#@*G" G#@#@*GD; insert into %+S+%3!TI&$ valuesFGpb*46AG" G#@:'+):#@G" G4G" G#@4G" G#@#@4GD; insert into %+S+%3!TI&$ valuesFGpb*@@AG" G4#:'+):#@G" G6G" G#@6G" G#@#@6GD;

B.'+-+T+ from %+S+%3!TI&$ where )I'HG#@4G

S-ar putea să vă placă și