Railway Reservation Sameer
Railway Reservation Sameer
SCHOOL
NEW PALAM VIHAR, SECTOR-11O,
GURUGRAM
A Project Report On
“RAILWAY RESERVATION SYSTEM”
For 2024-2025 Examination
As a part of the Informatics Practices (065)
01 ACKNOWLEDGEMENT 04
02 INTRODUCTION 05
04 PROPOSED SYSTEM 06
07 FLOW CHART 15
08 SOURCE CODE 16
09 OUTPUT 19
12 BIBLIOGRAPHY 24
RAILWAY RESERVATION SYSTEM
INTRODUCTION
based project done with help of python language. This project is very use
full for thepeople to book or cancel train tickets by sitting at home with one
cell phone in their hand. This project can be modified for various
reservations.
problems.
software development.
wise saying “to err is human” no longer valid, it’s outdated to rationalize
your mistake. So, to keep pace with time, to bring about the best result
One has to use the data management software. Software has been
to maintain a lot of ledgers and a lot of paper work has to be done but
now software product on this organization has made their work faster and
easier. Now only this software has to be loaded on the computer and work
can be done.
This prevents a lot of time and money. The work becomes fully
INITIATION PHASE
PLANNING PHASE
IMPLEMENTATION PHASE
This phase is initiated after the system has been tested and accepted by
the user. In this phase, the system is installed to support the intended business
functions. System performance is compared to performance objectives
established during the planning phase. Implementation includes user
notification, user training, installation of hardware, installation of software onto
production computers, and integration of the system into daily work processes.
This phase continues until the system is operating in production in accordance
with the defined user requirements.
OPERATIONS AND MAINTENANCE PHASE
The system operation is ongoing. The system is monitored for continued
performance in accordance with user requirements and needed system
modifications are incorporated. Operations continue as long as the system can
be effectively adapted to respond to the organization’s needs. When
modifications or changes are identified, the system may reenter the planning
phase.
The purpose of this phase is to:
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='
root',passwd='manager')
cursor=mycon.cursor()
mycon.autocommit=True
s1="create database railway"
cursor.execute(s1)
s1="create table railway(name
varchar(100),phnovarchar(15) primary
key,age
int(4),gender
varchar(50),from_f varchar(100),to_t
varchar(100),date_d varchar(20))"
cursor.execute(s1)
s1="create table user_accounts(fname
varchar(100),lname
varchar(100),user_name
varchar(100) ,password varchar(100)
primary
key, phno varchar(15),gender
varchar(50),dob varchar(50),age
varchar(4))"
cursor.execute(s1)
elif ch1==4:
print('THANK YOU')
break
else:
print('1.yes')
print('2.no')
c=int(input("do you want to continue or not:")
while (c==1):
print(' 1.TICKET BOOKING',"\n",
'2.TICKET
CHECKING',"\n",'3.TICKET,
CANCELLING'"\n",'4.ACCOUNT
DETAILS',"\n",'5.LOG OUT')
ch=int(input('enter ur
choice:'))if ch==1:
ticket_booking()
elif ch==2:
ticket_checking()
elif ch==3:
ticket_cancelling()
elif ch==4:
checking_3()
elif ch==5:
print('THANK YOU')
break
else:
print('ERROR 404: ERROR PAGE NOT FOUND')
def ticket_booking():
import mysql.connector
Mycon=mysql.connector.connect
(host='localhost',
User='root', passwd='manager',
database='railway')
Cursor=mycon.cursor ()
mycon.autocommit=True
nm=input('enter your name:')
phno=input('enter your phone number:')
age=int(input('enter your age:'))
print(' M=MALE','\n','F=FEMALE','\n','N=NOT
TO
MENTION')
gender=input('enter your gender:')
Gender=gender.upper()
fr=input('enter ur starting
point:')to=input('enter your
destination:') date1=input('enter
date(dd):') date2=input('enter
month(mm):') date3=input('enter
year(yyyy):')
date=date1+"/"+date2+"/"+date3
a={'M':'MALE','F':'FEMALE','N':'NOT TO
MENTION'}
v=a[Gender]
s1="insert into railway values ('{}',{},
{},'{}','{}','{}','{}')".format(nm,phno,
age,v,fr,to,date)
cursor.execute(s1)
print('BOOKED SUCCESSFULLY')
def ticket_checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor(
)
mycon.autocommit=Tru
eprint('1.yes')
print('2.no')
ch=int(input("do you want to continue
ornot:"))
if ch==1:
phno=int(input('enter your phnone
number:'))
try:
phno=phno"
cursor.execute(s1)
data=cursor.fetchall()[0]
Data=list(data)
a=['NAME','PHONE,NUMBER','AGE','GENDER','STARTING
POINT','DESTINATION','DATE',]
print(a[0],'::::',Data[0].upper())
print(a[1],'::::',Data[1])
print(a[2],'::::',Data[2])
print(a[3],'::::',Data[3].upper())
print(a[4],'::::',Data[4].upper())
print(a[5],'::::',Data[5].upper())
print(a[6],'::::',Data[6])
except:
print('TICKET DOES NOT EXISTS')
elif ch==2:
print('THANK YOU')
else:
print('ERROR 404:PAGE NOT FOUND')
def ticket_cancelling():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor(
)
mycon.autocommit=Tru
eprint('1.yes')
print('2.no')
ch=int(input("do you want to continue
ornot:"))
if ch==1:
phno=input('enter your phone number:')
s1="delete from railway where phno=phno"
cursor.execute(s1)
print('TICKET CANCELLED')
elif ch==2:
print('THANK YOU')
else:
print('ERROR 404:PAGE NOT FOUND')
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor(
)
mycon.autocommit=Tru
e a=input('USER
NAME:') b=input('PASS
WORD:')try:
s1="select user_name from
user_accountswhere password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
print('
IS THIS YOUR ACCOUNT')
s1="select user_name from
user_accounts where password='{}'".format(b)
c1="select fname,lname from
user_accounts where password='{}'".format(b)
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+''+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
x = [ ' F I R S T
NAME','LAST NAME','PHONE
NUMBER','GENDER','DATE OFBIRTH','AGE']
s1="select
fname,lname,phno,gender,dob,age from
user_accounts where password='{}'".format(b)
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
print(x[0],':::',data[0])
print(x[1],':::',data[1])
print(x[2],':::',data[2])
print(x[3],':::',data[3])
print(x[4],':::',data[4])
print(x[5],':::',data[5])
print('
1. yes')
print('
2. no')
vi=int(input('enter your
choice:'))
if vi==1:
b1="delete from
FOUND')
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
def checking_1():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
f=input("FIRST NAME:")
l=input("LAST NAME:")
a=input('USER NAME:')
b=input('PASS WORD:')
c=input('RE-ENTER YOUR PASS WORD:')
ph=input("PHONE NUMBER:")
print('
M=MALE','\n','F=FEMALE','\n','N=NOTTO MENTION')
gen=input('ENTER YOUR GENDER:')
print("ENTER YOR DATE OF BIRTH")
d=input("DD:")
o=input("MM:")
p=input("YYYY:")
dob=d+'/'+o+'/'+p
age=input('YOUR AGE:')
v={'m':'MALE','f':'FEMALE','n':'NOT TO
MENTION'}
if b==c:
try:
c1="insert into user_accounts
values('{}','{}','{}','{}','{}','{}','{}','{}')".
format(f,l,a,b,ph,v[gen],dob,age)
cursor.execute(c1)
print('WELCOME',f,l)
return True
except:
print('PASSWORD ALREADY EXISTS')
return False
else:
print('BOTH PASSWORDS ARE NOT MATCHING')
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor(
)
mycon.autocommit=Tru
e a=input('USER
NAME:') b=input('PASS
WORD:')try:
s1="select user_name from user_accounts
where password='{}'".format(b)
c1="select fname,lname from
user_accountswhere password='{}'".format(b)
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+''+data1[1]
cursor.execute(s1) data=cursor.fetchall()
[0] data=list(data)[0]
if data==a:
print(' HII ',data1)
return True
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
def checking_3():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',us
er='root',passwd='manager',database='railway')
cursor=mycon.cursor(
)
mycon.autocommit=Tru
e a=input('USER
NAME:') b=input('PASS
WORD:')try:
s1="select user_name from user_accounts
where password='{}'".format(b)
c1="select fname,lname from
user_accountswhere password='{}'".format(b)
cursor.execute(c1)
data1=cursor.fetchall()[0]
data1=list(data1)
data1=data1[0]+''+data1[1]
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
else:
return False
except:
print('ACCOUNT DOES NOT EXIST')
menu()
OUTPUT
CHOICE WINDOW
IF CHOICE IS 5 OR MORE
IF CHOICE IS 5 OR MORE
BIBLIOGRAPHY
• Website: https://www.w3resource.com