Railway Reservation System
Railway Reservation System
:830728
#21/3 Ramachandrapura, Vidyaranyapura,
Jalahalli Post, Bangalore-560013
PROJECT DETAILS
SUBJECT: INFORMATICS PRACTICES
NAME:
CLASS: Grade XII
PROJECT NAME:RAILWAY RESERVATION SYSTEM
ACKNOWLEDGEMENT
1. Introduction
3. Implementation
4. Coding
5. Future Enhancements
6. Conclusion
7. Bibliography
INTRODUCTION
MODULES DESCRIPTION
SOFTWARE REQUIREMENTS:
System Type: 32-Bit Operating System
FRONT END: PythonVersion 3.7.0.
BACK END: MySQL 5.1, 5.3 with connector J
Supported Softwares: Python Libraries such as Pandas, Numpy,
matplotlib…
IMPLEMENTATION
CODING
CREATION OF DATABASE:
def connection():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='mana
ger',database='railway')
if mycon.is_connected():
print("successfully connected")
connection()
cursor=mycon.cursor()
mycon.autocommit=True
s1="create database railway"
cursor.execute(s1)
TABLE CREATION:
cursor=mycon.cursor()
mycon.autocommit=True
cursor.execute(s1)
cursor.execute(s1)
def menu():
print('1.YES')
print('2.NO')
ch=int(input('DO YOU WANT TO CONTINUE OR NOT:'))
while ch==1:
print('1.SIGN IN')
print('2.SIGN UP')
print('3.DELETE ACCOUNT')
print('4.EXIT')
if ch1==1:
a=checking()
if a==True:
print('WELCOME')
main()
else:
continue
elif ch1==2:
a=checking_1()
if a==True:
main()
else:
elif ch1==3:
c=checking_2()
if c==True:
print('ACCOUNT DELETED')
continue
else:
continue
elif ch1==4:
print('THANK YOU')
break
else:
break
def main():
print('1.yes')
print('2.no')
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('WRONG INPUT')
else:
def ticket_booking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
Gender=gender.upper()
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]
cursor.execute(s1)
print('BOOKED SUCCESSFULLY')
def ticket_checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
if ch==1:
try:
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:
elif ch==2:
print('THANK YOU')
else:
def ticket_cancelling():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
ch=int(input("do you want to continue or not:"))
if ch==1:
cursor.execute(s1)
print('TICKET CANCELLED')
elif ch==2:
print('THANK YOU')
else:
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
cursor.execute(s1)
data=cursor.fetchall()[0]
data=list(data)
if data[0]==a:
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:
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')
if vi==1:
cursor.execute(b1)
return True
elif vi==2:
print('SORRY,RETRY')
else:
else:
return False
except:
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
f=input("FIRST NAME:")
l=input("LAST NAME:")
n=f+" "+l
a=input('USER NAME:')
b=input('PASS WORD:')
ph=input("PHONE NUMBER:")
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:
cursor.execute(c1)
print('WELCOME',f,' ',l)
return True
except:
return False
else:
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
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:
return True
else:
return False
except:
def checking_3():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='root',passwd='manager',da
tabase='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
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:
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])
else:
return False
except:
menu()
FUTURE ENHANCEMENTS
Books:
1. Informatics Practices XII-by Sumita Arora
2. Together With IP Textbook-by Rachana Sagar
Websites:
1. www.wikipedia.com
2. www.googleimages.com
3. www.dev.mysql.com