0% found this document useful (0 votes)
7 views

CSINVST

The document is an investigatory project report on a Train Ticket Reservation System (TTRS) submitted by S. Pranav as part of the CBSE SSC requirements. It outlines the need for an efficient TTRS to facilitate ticket booking for the increasing number of train travelers, utilizing Python and SQL for functionality. The project aims to improve user experience by allowing online booking, ticket modifications, and real-time train status updates, while also addressing issues related to data redundancy and accessibility.

Uploaded by

kannanratha2007
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

CSINVST

The document is an investigatory project report on a Train Ticket Reservation System (TTRS) submitted by S. Pranav as part of the CBSE SSC requirements. It outlines the need for an efficient TTRS to facilitate ticket booking for the increasing number of train travelers, utilizing Python and SQL for functionality. The project aims to improve user experience by allowing online booking, ticket modifications, and real-time train status updates, while also addressing issues related to data redundancy and accessibility.

Uploaded by

kannanratha2007
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

TRAIN TICKET RESERVATION SYSTEM

An Investigatory Project Report

Submitted in partial fulfillment of the requirement of CBSE SSC

By Pranav S

Kendriya Vidyalaya
(Affiliated to CBSE)

CECRI Campus

College Road, Karaikudi – 630006

FEBRUARY 2024
DECLARATION
I hereby declare that the investigatory project entitled Train Ticket Reservation
System, submitted in partial fulfillment of the requirement of CBSE SSC 2023-24,
is a record of the work of my very own carried out by me under the supervision and
guidance of Ms. V. N. Shobana, PGT Computer Science, Kendriya Vidyalaya
Karaikudi. The source of information has been derived from the suitable literature
and appropriate credit has been given to the original sources in places where it is
due. This work has not been submitted as part of any project in other institutions or
competitions.

S. PRANAV
XII-A

It is with thorough revisal that I certify that the declaration made by the
aforementioned candidate is absolutely true.

Ms. V.N. SHOBANA


PGT Computer Science
Kendriya Vidyalaya Karaikudi

i
Kendriya Vidyalaya Karaikudi

Affiliated to CBSE

BONAFIDE CERTIFICATE

This is to certify that the project entitled Train Ticket Reservation System
is a bonafide record of work done by S. Pranav, studying in class XII-A of register
number:

during the period 2023-2024 of his study under the guidance of Ms. V.N. Shobana,
PGT Computer Science, towards the partial fulfillment of the requirement for the
CBSE SSC.

Teacher-in-charge

Submitted for the Practical Examination held on .

Internal Examiner External Examiner

Principal

ii
ABSTRACT

The need for an efficiently functioning Train Ticket Reservation System


(TTRS) is imminent, for as suggested by various researches, over 1.8 billion people prefer
to take the train for travel every year and these numbers are envisioning a rise in the coming
years. In such a scenario, it is crucial to make it easy for the passengers to find their way
towards securing their seats for a train journey, no matter the length of the destination they
plan travelling to, assisting them through the extended process, and easing them of the
hassles that come with traveling to railway stations and waiting in front of ticket counters
for booking their tickets. This investigatory project hopes to explore the nuances of such a
Train Ticket Reservation System, employing the scenario of booking tickets in the British
Railways as an example.

The model constructed as part of the project combines the beneficial


functionalities of the Python Programming Language and the easy-to-use interface of SQL
databases to retrieve significant details that includes the likes of getting passenger ticket
status and seeking out train status, as in, checking if a train is running tardy or is on time.
It also allows the modification of existing passenger details and allows the users to book a
new ticket to a location they wish to travel to as part of the routes taken by the British
Railways.

iii
ACKNOWLEDGEMENT

I’d like to take this wonderful moment to express my heartfelt gratitude to everyone at
Kendriya Vidyalaya Karaikudi for making it possible to complete this investigatory project.
I am highly indebted to Mr. Nand Lal Jangid, Principal of this most esteemed institution
for his constant support, providing me with a scientific and conductive atmosphere that
helped me finish this project on time.

A self-made gratitude from my heart to Ms. V.N. Shobana, PGT Computer Science for her
valuable support, motivation and guidance.

A special thanks to my parents and my sister for their constant support, encouragement,
and for extending a shoulder to keep me motivated till the end by being my biggest
cheerleader.

Last but not the least, my bowings to the almighty for showering me with the strength,
confidence and ideas for completing this project.

S. Pranav
XII-A

iv
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO.


NO.
ABSTRACT iii
ACKNOWLEDGEMENT iv
LIST OF FIGURES vi
1 INTRODUCTION 1
2 LITERATURE SURVEY 4
3 SYSTEM CONFIGURATION 7
i. HARDWARE SPECIFICATION 7
ii. SOFTWARE SPECIFICATION 7
4 SOFTWARE OVERVIEW 9
5 SYSTEM SPECIFICATION 14
6 SYSTEM STUDY 16
7 SYSTEM ARCHITECTURE 19
8 EXPERIMENTAL RESULTS 34
9 SYSTEM TESTING 41
10 CONCLUSION AND FUTURE SCOPE 44
LIST OF FIGURES

Figure No. Figure Name Page No.

4.1 The Man, the Myth, and the Legend: Guido van 10
Rossum

4.2 Michael Widenius and MySQL 12

6.1 System Flow (User) 20

6.2 System Flow (Admin) 21

7.1 Application for performing TTRS Operations 35

7.2 Fetching Query to Book Ticket 36

7.3 Carrying out the booking 36

7.4 Query to retrieve passenger details (Admin End) 37

7.5 Query to retrieve train details (Admin End) 37

7.6 Query to retrieve passenger details (Admin End) 38

7.7 Query to retrieve train status 38

7.8 Interface to check train status 39

7.9 Query to modify passenger details (Admin End) 39

7.10 Testing User Feasibility through rating 40


INTRODUCTION

1
CHAPTER 1

INTRODUCTION

In the emerging digital world, the importance of programming, coding and usage of
computing systems has increased. We tend to apply these concepts to our everyday
important works. We use computing and coding in ticket booking systems, attendance
sheets, maintain lists in institutions and further usage in simple institutions such as stores,
shops thus maintaining record of everything. But in most of situations we target local file
system to develop, which isn’t feasible since it is only accessible locally and not available
globally. This project aims to apply computing and coding to one Train ticket reservation
system (TTRS). Currently, TTRS is widely used in stations in India but does not allow an
easy access for individuals to book the train tickets, causing them to wait in large queues.
This also leads to unnecessary delay. Plus, allowance of individuals to book tickets on the
go is one of the important aspects of this project.

The data redundancy caused due to local file system is a means to an end and
unnecessary complications. Complications which include the following scenarios:

i) Suppose a passenger wants to reach a particular destination but unfortunately


isn’t able to book ticket from a different station.
ii) A passenger who wants to urgently book a ticket but is unable to due to static
queues in booking counter.
iii) A passenger who wants to look up to his ticket confirmation but requires a
second mode to look for his ticket confirmation, one which includes a severe
complication.
iv) Due to locally available data both an administrator and a passenger isn’t able to
look up to his ticket in different stations.
v) A Passenger who wants to change his destination but has already booked a ticket
with money paid; a means to loss for the person upon cancellation.

2
Due to these many complications with file system, we tend to use database model,
which allows a secure pathway to access data remotely anywhere in any station. This
project aims to integrate SQL- Structured query language with Python to provide a user-
friendly access to whatever the passenger or an administrator wishes.

This project aims to achieve the following goals:

i) To book a ticket from a given station for trains stopping at that station.
ii) To allow passengers to book and cancel a ticket.
iii) To allow passengers to modify an existing ticket with the help of a station
administrator.
iv) To allow passengers to look up to running status and arrival of trains to that
particular station.
v) To allow passengers to get a copy of their ticket while travelling, along with an
opportunity for the passengers to look up to their ticket status.
vi) To allow station administrators to keep track of all passenger booking details to
monitor unusual activities.
vii) To prevent passengers from travelling without ticket.

This project aims to help railways become profitable and sustainable as given in the
above goals to be achieved. This project also aims for TTRS in becoming an important
vendor for Railways. Progressing through working about sustainability not just for the
Railways, the project hopes to make the system a tool that’d transform railway travels a
piece of cake. Consequently, the project couples the key ideas of Python with SQL by
employing integration through MySQL. With this, the project hopes to allow passengers
look up their details using TTRS, both in the online and the offline mode by employing
DBMS and file system (local) methods respectively.

3
LITERATURE SURVEY

4
CHAPTER 2

LITERATURE SURVEY

Wang Zongjiang (2012) presented a method that entwines the advantages of rough
sets and prisoner’s reform to define rule usefulness, a terminology that’d help define useful
rules to help combat the disproportionation in the huge customer base the railway sector of
China entertains against the tedious process of buying train tickets due to fewer e-
commerce sites that present train tickets to acquire. The proposal involved a three-layer
structure, namely, the database layer, the application services layer, and the user interface
layer for carrying out services like holding data, registering user information, and setting
up execution on a remote computer. The system built also employed various functions
that’d help carry out booking, registration, cancellation, searching, and refunding of train
tickets. Upon careful developments, the system was structured into three layers, namely
data access layer, business logic layer, and business exterior layer for trial run in the market
to mark its commercial launch.

Sourodeep Chatterjee et al. (2020) presented a model that hoped to implement


necessary facilities like dynamic seat allocation and real-time charting. With the system
built, the authors hoped to automate the entire process, which would help allocate seats
dynamically if found to be vacant in the midst of a journey, thus giving passengers who
need to book a train in case of emergencies an upper hand. With a system like this, the
moral dilemma of the TTE over having to be sandwiched between work ethics, and
personal needs of the passenger is resolved. The system also provides layout for passengers
to choose a seat of their choice by storing every transaction ever made through the portal.
Further studies suggested that the model was extremely efficient, consistently offering the
desired results and floating through without the bare requirement of minimum internet
connectivity.

5
Peddy Oliva Joicy et al. (2021) constructed a system that allowed the enquiry of
necessary details to make the travel process through train comfortable. Depending on the
source of destination, cancellation of tickets, enquiry about the status of book tickets, and
real-time updates about their chosen train’s running status particularly in times of distress,
the system utilizes a data base to store the records required and the notes about the trains,
their destinations, and the passengers. With the design and implementation of such a
system, the authors hope to offer a secure, error-free, reliable, and swift management to the
society of users who wish to have a train journey to remember, continuing to have a passion
for train travelling, but have been restrained to do so owing to the hassles involved.

6
SYSTEM
CONFIGURATION

7
CHAPTER 3

SYSTEM CONFIGURATION

i. HARDWARE SPECIFICATION

Laptop Model HP Notebook 15


Processor Intel® Core™ i7-6500U CPU @2.50 GHz 2.60
GHz
Processor Cores 2
Processor Threads 4
Memory 8 GB
Processor Architecture 64-bit x64 based processor

ii. SOFTWARE SPECIFICATION

Operating System Windows 10 Home Single Language


OS Version 22H2
IDE used Python IDLE | MySQL Command Line Client | MySQL
Workbench CE
IDLE version Python 3.12
MySQL version 8.0.32

8
SOFTWARE
OVERVIEW

9
CHAPTER 4

SOFTWARE OVERVIEW

I. PYTHON

A very popular programming choice in the 21st century owing to its “simple-to-
use, easy-to-understand, and piece-of-cake-to-implement” quality, Python is a
widely employed, interpreted, object-oriented, cool, and high-level
programming language that rides on dynamic semantics finding usability in
general-purpose programming.

Figure 4.1: The Man, the Myth, and the Legend: Guido van Rossum

Conceived in the 1980s by Guidon van Rossum as the potential successor with
exception handling capabilities to the ABC Programming Language at Centrum
Wiskunde and Informatica, Netherlands, Python was introduced as the newest
progeny in the programming world in February 20, 1991. Despite its references
to the well-known reptile, python, the name of the programming language

10
actually traces its roots back to an old BBC comedy sketch series called Monty
Python’s Flying Circus.

Python, in today’s world is present everywhere, and if one had to quote an


analogy between Samuel Taylor Coleridge’s lines, Water, water every where,
And all the boards did shrink; Water, water every where, nor any drop to drink,
from his famous long-form poem, “The Rime of The Ancient Mariner”, one
could say, Python, python every where, a language to tinker and think; Python,
python every where, and many job doors that open for ye to drink.

People use python every day on a walk-in basis without realizing it, and the
community that python supports is always happy to help when a programmer
knocks on their doors. Plus, it is easy to learn, faster to start programming, simple
for crafting new software, and as easy as ABC to employ and deploy the codes
penned owing to its free use. Showing roads to many programmers to find scopes
in several industries, Python has always offered space for a programmer to get
ideas to learn from and implement, finding application in data analytics,
DevOps, Machine Learning, Web Development, and Testing.

For the sake of the project, a Python IDLE of version 3.12 is used to connect
with MySQL databases for the purpose of implementation of the TTRS.

11
II. MySQL

Enjoying the advantage of being the most popular open-source database,


MySQL is a Relational Database Management System (RDBMS) that enables
users to store, manage, and retrieve structured data efficiently. It is widely used
for various applications, from small-scale projects to large-scale websites and
enterprise-level solutions. This DBMS powers many popular applications like
Facebook, X (Formerly Twitter), Netflix, Uber, Shopify, Airbnb, and
Booking.com.

Fig 4.2: Michael Widenius and MySQL

Tracing its name back as the coupling of its founder, Michael’s daughter’s name,
“My”, and its application as a structured query language, MySQL is written in
C and C++. The dolphin embracing the MySQL logo is christened Sakila by
Ambrose Twebaze, an open-source software developer. Working in a client-
server interface composing of a multithreaded SQL server supporting several
back ends, client programs and libraries, administrative tools, and a wide range

12
of APIs, MySQL allows a user application to get a smaller, swifter, and simple
to manage stand-alone product. Its reliability, scalability, flexibility, excellent
performance, and high availability is taken leverage of in this project. The
system studied employs MySQL version 8.0.32 and utilizes a MySQL command
line client and MySQL Workbench CE for the purpose of building a DBMS that
stores the required data for implementation of an efficiently functioning TTRS.

13
SYSTEM
SPECIFICATION

14
CHAPTER 5

SYSTEM SPECIFICATION

Operating System  Unix based: Windows 10 or higher


 Linux-Distro based: Refer documentation in website
Software  Python IDLE: 3.5 or higher
 MySQL Command Line Client: 5.7 or higher
Architecture of OS 32-bit or higher
Memory Requirements 4 GB or higher

15
SYSTEM STUDY

16
CHAPTER 6

SYSTEM STUDY

6.1 FEASIBILITY SYSTEM


The feasibility of the project is studied and a business proposal is presented forward
with a rough estimate of rolling the project forth in the market and the amount of
money that’d be required to progress through. During system analysis, the feasibility
of the system was also carried out in an attempt to ensure that it makes the returns
that the mission and vision of the project promise to offer. For feasibility analysis,
some understanding of the major system requirements is necessary.
The three considerations made for feasibility analysis are:
Economic Feasibility
Technical Feasibility
Social Feasibility

6.1.1 Economic Feasibility


This analysis is carried out to check the economic impact that the system will
have on the organization. The amount of fund that the stakeholder can pour
into the research and development of the system is limited as a result of which
there is a need to justify the cashflow and the expenditures undertaken while
working on the project.
Conclusion: On analysis, the system was found to be well within the budget
that can be accommodated by startups. This has to be attributed to the easy
accessibility of the software used.

6.1.2 Technical Feasibility


This analysis is carried out to check the technical feasibility, or in other
words, the technical requirements of the system. Any system developed must

17
not have a high demand on the available technical resources. This might lead
to a high demand resourcing directed towards the client.
Conclusion: Upon analysis, the developed system was found to be
consumer friendly, for minimal requirements were only necessary to
implement this system.

6.1.3 Social Feasibility


This faction of the analysis focuses on checking the level of acceptance of
the system by the user. Meaning, there is a necessity to make the user
comfortable with using the system efficiently. The user must not feel
threatened by the system. Instead, the consumer must accept it as a necessity.
Confidence of the user must be raised so that he/she might be able to make
some constructive criticism, which would be welcomed from the developer’s
end, for a user is the final and significant tester of the system

18
SYSTEM
ARCHITECTURE

19
CHAPTER 7

SYSTEM ARCHITECTURE

System Flow Diagram

Fig 6.1: System Flow (User)

The system constructed for the purpose of execution of the goals of the project employs a
combination of MySQL and Python integrated into a TTRS app that accepts input
according to user requirements. With this, the app takes in details regarding booking of a
new ticket and cancellation of an existing ticket and returns status of a train that is running
depending upon the time given and passenger status, like whether a booked ticket is under
the status pending confirmation (RAC) or confirmed booking.

20
Fig 6.2: System Flow (Admin)

The admin, on the other, can access the user details and modify train status by logging into
the app with administration privileges and get the app to send the modified details to the
user as a notification or as an SMS.

System Algorithm

1. Start.
2. Enter into the TTRS portal.
3. Choose the appropriate block depending upon whether you are planning to check
your reservation status or would like to book a ticket.
4. If you’d like to book a ticket, enter the necessary details relevant to the query as
prompted, like your name, the destination, and the point from which you’d like to
embark on the journey.

21
5. If you’d like to cancel a ticket, mention the date you booked as the query to let the
system fetch the necessary details from the database to proceed with the
cancellation.
6. If you’d like to check if trains are running late or on time, provide the details as
required to let the system fetch the results for you.
7. If you are an admin, repeat steps 2 and 3 and allow the system to fetch the relevant
element from the attribute/tuple to modify the desired details.
8. Fire an SMS once booking, cancellation, or modification of passenger status is done.
9. Stop.

System Flowchart

Y N

22
23
System Code

import mysql.connector as mysql


from datetime import datetime
con= mysql.connect(host= "localhost", user= "root", passwd= 'ambrosian@2001',
database= 'bstatus')
cur= con.cursor()
now= datetime.now()
print("")
print(" |_______________________________________GBR: GREAT
BRITAIN RAILWAY TTRS Vendor_________________________________________|
")
print("")
print("Station Name: Trent Bridge ", '\t', '{:>150}'.format("Railways Section: Western
Railways (WR)"))
print("=========================================================
==============================================================
==============================================================
===")
print("Station ID: WEGBR23", "\t", '{:>142}'.format("TTRS SYS STATUS: Online"))
print("=========================================================
==============================================================
==============================================================
===")
print("VENDOR SYNC DATE AND TIME: ", now.strftime("%d/%m/%Y ||
%H:%M:%S"))
print("=========================================================
==============================================================

24
==============================================================
===")
print('')
while True:
print("Processes")
print("_________")
print("")
print("Enter GBR0 to exit")
print("Enter GBR1 to get status of Passenger Ticket and other related status")
print("Enter GBR2 to get status of train")
print("Enter GBR3 to modify existing passenger details (RA)")
print("Enter GBR4 to book a new ticket")
print("")
x= input("Enter your choice: ")
if x.upper()=="GBR0":
break
if x.upper()=='GBR1':
while True:
print("")
print("Enter G0 to exit this section")
print("Enter G1 to get Pasenger Ticket Status")
print("Enter G2 to get full passenger Ticket")
print('')
a= input("Enter your choice: ")
if a.upper()=='G1':
y= int(input("Enter Passenger ID: "))
cur.execute("select status from b1status where PID="+str(y))
z= cur.fetchone()

25
print('''Guidelines for Ticket status:
1. W/L- Waiting list
2. C- Confirmed
3. N/C- Not Confirmed''', sep='')
print("Note: N/C and W/L are different. For further clarification enter Y in Unit
U1")

print("=========================================================
=====================")
print("Status of your ticket: ")
print(z[0])

print("=========================================================
======================")
v= input("Unit U1: Do you want any futher clarifications? (Y/N): ")
if v.upper()=='Y':
print("")
print("Clarification Regarding W/L and N/C")
print("")
print("---W/L means you have booked your ticket completely and requires
status confirmation from higher officials")
print("---N/C means your ticket booking has been incomplete. Contact your
train operator to get it confirmed")
print("")
if a.upper()=='G0':
break
if a.upper()=='G2':
io= [0, 125]

26
c= int(input("Enter administator key if you are an admin. If not enter 0: "))
if c==0:
print("")
m= int(input("Enter Passenger ID: "))
cur.execute("select * from b1status where PID="+str(m))
b= cur.fetchone()
print("")
print("Passenger ID \t", '{:>18}'.format("Passenger Name"),
'{:>28}'.format("Destination"), '{:>20}'.format("Ticket Status"), '{:>15}'.format("Train
No"))

print("=========================================================
==============================================================
===========================")
print(b[0], "\t", '{:>25}'.format(b[1]), '{:>30}'.format(b[2]),
'{:>15}'.format(b[3]), '{:>15}'.format(b[4]))
if c==125:
print("")
cur.execute("select * from b1status")
f= cur.fetchall()
print("Passenger ID \t", '{:>18}'.format("Passenger Name"),
'{:>28}'.format("Destination"), '{:>20}'.format("Ticket Status"), '{:>15}'.format("Train
No"))

print("=========================================================
==============================================================
===========================")
for i in f:

27
print(i[0], "\t", '{:>25}'.format(i[1]), '{:>30}'.format(i[2]),
'{:>15}'.format(i[3]), '{:>15}'.format(i[4]))

print("=========================================================
==============================================================
===========================")
if c not in io:
print('')
print("ERROR: Please Re enter your value")
if x.upper()=="GBR2":
while True:
print('')
print("Enter 0 to exit this section")
print("Enter 1 to get specific train running status")
print("Enter 2 to get all trains running status")
print("")
d= int(input("Enter your choice: "))
if d==0:
break
if d==1:
y= input("Please enter your train number: ")
cur.execute("select * from b2status where Tno="+str(y))
har= cur.fetchone()
if har==None:
print('')
print("The train of given train number does not pass through this station.
Please re enter the train no")
else:

28
print("Train No. \t", '{:>18}'.format("Source of Origin"),
'{:>28}'.format("Destination"), '{:>35}'.format("Scheduled Arriving Time"),
'{:>28}'.format("Scheduled departure Time"), '{:>26}'.format("Ariving status"))

print("=========================================================
==============================================================
========================================")
print(har[0], "\t", '{:>25}'.format(har[1]), '{:>30}'.format(har[2]),
'{:>23}'.format(har[6]), '{:>25}'.format(har[4]), '{:>36}'.format(har[3]))
if d==2:
cur.execute("select * from b2status")
h2= cur.fetchall()
print("Train No. \t", '{:>18}'.format("Source of Origin"),
'{:>28}'.format("Destination"), '{:>35}'.format("Scheduled Arriving Time"),
'{:>28}'.format("Scheduled departure Time"), '{:>26}'.format("Ariving status"))

print("=========================================================
==============================================================
===============================================")
for j in h2:
print(j[0], "\t", '{:>25}'.format(j[1]), '{:>30}'.format(j[2]),
'{:>23}'.format(j[6]), '{:>25}'.format(j[4]), '{:>36}'.format(j[3]))

print("=========================================================
==============================================================
===============================================")
if x.upper()=='GBR3':
print('')

29
print('''CAUTION:
---This section requires the prescence of an administrator
---Anyone who tampers with details of passenger details shall be detained, and a
penalty of more than 1500 pounds is expected to be paid henceforth''')
print('')
k= int(input("Enter Administrator password to continue further: "))
if k==125:
while True:
print('')
print("Enter F1 to exit this section")
print("Enter F2 to modify existing passenger details")
print('')
g= input("Enter your choice: ")
print('')
if g.upper()=='F1':
break
if g.upper()=='F2':
g1= int(input("Enter Person Id: "))
print('')
cur.execute("select * from b1status where PID="+str(g1))
hj= cur.fetchone()
if hj==None:
print("The given passenger number doesn't exist. Please try again")
else:
fg= input("Enter new destination location: ")
cur.execute("select * from b2status where Destination in
(\"{}\")".format(fg))
hj= cur.fetchall()

30
if len(hj)==0:
print('')
print("Please re enter the destination for the trains passing through this
station")
else:
print('')
print("Available Trains and Timings")
print('')
print("Train NO.", '\t', '{:>9}'.format("Timings"))
print("=============================")
for ft in hj:
if ft[5]>0:
print(ft[0], '\t', '{:>18}'.format(ft[4]))
print('')
hg= int(input("Enter suitable train no. from the above list as per
timings: "))
cur.execute("update b1status set Dest= (\"{}\") where PID=
(\"{}\")".format(fg, g1))
cur.execute("update b1status set Status= (\"{}\") where PID=
(\"{}\")".format("C", g1))
cur.execute("update b1status set Tno= \"{}\" where PID=
\"{}\"".format(hg, str(g1)))
con.commit()
cur.execute("select * from b1status where PID="+str(g1))
jk= cur.fetchone()
print("")
print("New Ticket for the Passenger")

31
print("=========================================================
==============================================================
===========================")
print("Passenger ID \t", '{:>18}'.format("Passenger Name"),
'{:>28}'.format("Destination"), '{:>20}'.format("Ticket Status"), '{:>15}'.format("Train
No"))

print("=========================================================
==============================================================
===========================")
print(jk[0], "\t", '{:>25}'.format(jk[1]), '{:>30}'.format(jk[2]),
'{:>15}'.format(jk[3]), '{:>15}'.format(jk[4]))
else:
print('')
print("ERROR: Wrong Administrator Password. Please Re Enter the
Administrator Password")
print('')
if x.upper()=='GBR4':
t= input("Enter the Passenger name: ")
t2= input("Enter the Destination: ")
print('')
cur.execute("select * from b2status where Destination in (\"{}\")".format(t2))
n= cur.fetchall()
if len(n)==0:
print("Please re enter the destination for the trains through this station")
print('')
else:

32
print("Available Trains and Timings: ")
print("Train NO.", '\t', '{:>14}'.format("Timings"))
print("============================================")
for df in n:
if df[5]>0:
print(df[0], '\t', '{:>18}'.format(df[4]))
cur.execute("select PID from b1status")
n1= cur.fetchall()
fer= len(n1)+1
ji= int(input("Enter your suitable train no. as per timings: "))
cur.execute("insert into b1status values({}, \'{}\', \'{}\', \'{}\', {})".format(fer, t,
t2, 'C', str(ji)))
con.commit()
cur.execute("select * from b1status where PID= "+str(fer))
ty= cur.fetchone()
print('')
print("Congrats! your Ticket has been successfully booked!")
print('')
print("Passenger ID \t", '{:>18}'.format("Passenger Name"),
'{:>28}'.format("Destination"), '{:>20}'.format("Ticket Status"), '{:>15}'.format("Train
No"))

print("=========================================================
==============================================================
===========================")
print(ty[0], "\t", '{:>25}'.format(ty[1]), '{:>30}'.format(ty[2]),
'{:>15}'.format(ty[3]), '{:>15}'.format(ty[4]))
print('')

33
EXPERIMENTAL
RESULTS

34
CHAPTER 8

EXPERIMENTAL RESULTS

The system was constructed by entwining the concepts of SQL and Python to arrive at the
desired results. Running the application for the purpose of accomplishing the objectives of
a Train Ticket Reservation System received inputs appropriately and fed the receptions
back to the TTRS database.

Fig 7.1: Application for performing


TTRS Operations

35
Fig 7.2: Fetching Query to book ticket

Fig 7.3: Carrying


out booking

36
Fig 7.4: Query to retrieve passenger details (Admin End)

Fig 7.5: Query to retrieve train details (Admin End)

37
Fig 7.6: Query to retrieve passenger details (Admin End)

Fig 7.7: Query to retrieve train status

38
Fig 7.8: Interface to Check
Train Status

Fig 7.9: Query to modify passenger details (Admin End)


39
Fig 7.10: Testing User Feasibility
through rating

40
SYSTEM TESTING

41
CHAPTER 9

SYSTEM TESTING

10.1 Testing Objectives


Testing could be described as the process of executing a program with the intent of
tracing an error. A test that possesses a high probability of finding undiscovered
errors is often known as a good test. On the other hand, a test that unearths hidden
errors is known as a successful test.

10.2 Type of Testing Done


The seven laws of computing state that “Any non-trivial program should contain at
least one bug. No trivial programs are of existence.” Hence, to discover at least one
error in the program, the proper choice of data is important. Consequently, live data
has been used.

10.2.1 Unit Testing


This kind of testing is carried out on the smallest unit of software design,
often referred to as the module. Hence, this testing is sometimes also known
as Module Testing. The testing of the modules is carried out separately
during the programming stage. In the system built, each module has been
found to work satisfactorily, presenting the desired output.

10.2.2 Integration Testing


This kind of testing deals with a systematic technique for constructing tests
that uncover the errors associated with the operating interface. For the system
built, the entire program was tested as a whole, and the errors that were
uncovered were subsequently corrected.

42
10.2.3 Validation Testing
This kind of testing ensures that the requirements established in accordance
with the software environment are validated, thus providing a needed
assurance to the stakeholder that the software meets the necessary functional,
behavioural, and performance requirements.

10.2.4 Performance Testing


This testing determines the time efficiency of a system to process and execute
data. For example, if the processing of ticket booking takes too long, the
system won’t be efficient. This processing time is adjusted accordingly
during implementation and is imbibed into a working system.

10.2.5 Function Testing


This testing ensures the functionality of the system constructed.

43
CONCLUSION
AND
FUTURE SCOPE

44
CHAPTER 10

CONCLUSION AND FUTURE SCOPE

An efficient Train Ticket Reservation System was successfully constructed by entwining


the concepts of SQL and Python to take inputs from the application created. The received
inputs were then stored in the TTRS database where it would be effectively accessed by
specifying the appropriate query.

The system constructed can be enhanced further to become a fully-functioning website


adaptable for computer, tablet, and mobile use. With this, the vendor might be able to
visualize a better scope for selling the goods created by exploring and finding a wider
audience for their creation. One may also find this system flexible in trying to integrate and
implement options for proceeding with their payment once booking is done. As an
extension, offering options for making their payment, like either through credit card, or net
banking, and refundability may also work well. Choices of the source stations from where
passengers would like to embark on their journey and the destinations upto which the
passengers would like to extend their journey to can be increased.

At length, the project can be molded to become better for commercial use, adapting it in
accordance with the requirements of the day as the current markets expect. With such
brilliant Train Ticket Reservation Systems, one can always work their way about
sustainability and transform railway travels a piece of cake.

In the end, train journeys have always been favoured by many owing to the rendezvous of
the travelling medium with the beautiful nature all the while accompanied by memories to
relish, savourites to taste, and stories to tell as the train goes “Hoo-Hoo”

They're two, they're four, they're six, they're eight


Shunting trucks and hauling freight
Red and green and brown and blue
They're the Really Useful crew

45
All with different roles to play
'round Tidmouth Sheds or far away
Down the hills and round the bends
Thomas and his friends

46
REFERENCES

47
CHAPTER 9

REFERENCES
Book References

[1] Wang Zongjiang, Railway Online Booking System Design and Implementation,
Physics Procedia, Volume 33, 2012, Pages 1217-1223, ISSN 1875-3892,
https://doi.org/10.1016/j.phpro.2012.05.202.
[2] S. Chatterjee, S. Das, Divisha, B. Goswami, P. Nag and C. Pradhan, "REVITS:
Railway E-Verification Information and Ticketing System," 2020 International
Conference on Communication and Signal Processing (ICCSP), Chennai, India,
2020, pp. 0992-0995, doi: 10.1109/ICCSP48568.2020.9182191.

[3] Peddi Oliva Joicy and Vidiyala Prathyusha, “Railway Reservation System”,
Easy Chair, 2021. Railway Reservation System (easychair.org)

[4] NCERT Computer Science Textbook Class XII

Website References

[5] About Python (pythoninstitute.org)

[6] What is MySQL: MySQL Explained for Beginners (hostinger.com)

[7] What Is MySQL? | Oracle

[8] MySQL - Wikipedia

48

You might also like