Cse Project Final
Cse Project Final
Cse Project Final
INVESTIGATORY
PROJECT
CONTENTS
CONTENT
SR.NO PAGE NO.
1 INTRODUCTION TO 2
PYTHON
2 INTRODUCTION TO 3
PROJECT
3 SYSTEM 4
REQUIREMENTS
6 SOURCE CODE 6
7 MOTIVES 17
8 SCREENSHOTS OF 18
OUTPUTS
9 BIBLIOGRAPHY 23
INTRODUCTION TO PYTHON:
1. Easy to use: python is compact and very easy to use object-oriented language
with very simple syntax rules. Hence less time is required to understand and
learn python programming and its user friendly
2. cross platform language: python can run across different platforms like
windows, Linux mac etc.
INTRODUCTION
The objective of this project is to let the students apply the programming
knowledge into a real- world situation/problem and exposed the students how
programming skills helps in developing a good software.
● Windows 7 or higher.
SOURCE CODE
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root')
cursor=mycon.cursor()
mycon.autocommit=True s1="create
database railway" cursor.execute(s1)
s1="create table railway(name varchar(100),phno varchar(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)
def menu():
print('1.YES')
print('2.NO')
while ch==1:
a=checking() if
a==True:
print('WELCOME') main()
else:
continue elif
ch1==2:
a=checking_1() if
a==True:
main()
else:
print('PASSWORD ALREADY EXISTS')
continue elif
ch1==3:
c=checking_2() if
c==True:
print('ACCOUNT DELETED’)
continue else:
print('YOUR PASSWAORD OR USER_NAME IS
INCORRECT')
continue
elif ch1==4:
print('THANK YOU')
break
else:
def main():
print('1.yes')
print('2.no')
while (c==1):
break
else:
v=a[Gender]
cursor.execute(s1) print('BOOKED
SUCCESSFULLY')
def ticket_checking(): import
mysql.connector
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
if ch==1:
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:
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
print('1.yes')
print('2.no')
elif ch==2:
print('THANK YOU')
else:
def checking_2():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
a=input('USER NAME:')
b=input('PASS WORD:')
try:
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:
print(x[2],':::',data[2])
print(x[3],':::',data[3])
print(x[4],':::',data[4])
print(x[5],':::',data[5])
print('
print('
1. yes')
vi=int(input('enter your
choice:')) if vi==1:
2. no') b1="delete from
print(x[0],':::',data[0]) user_accounts
cursor.execute(b1) return
True
elif vi==2:
print('SORRY,RETRY')
else:
return False
else:
except:
def checking_1():mycon=mysql.connector.connect(host='localhost',user='
return True
except:
print('PASSWORD ALREADY EXISTS')
return False
else:
def checking():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
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_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)
[0]
if data==a:
print(' HII ',data1) return True
else:
return False
except:
def checking_3():
import mysql.connector
mycon=mysql.connector.connect(host='localhost',user='
root',passwd='root',database='railway')
cursor=mycon.cursor()
mycon.autocommit=True
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_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=['FIRST NAME','LAST NAME','PHONE
NUMBER','GENDER','DATE OF BIRTH','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]) else:
return False
except:
menu()
MOTIVES:
A railway reservation system like IRCTC (Indian Railway Catering and Tourism
Corporation) manages millions of users and transactions daily, handling
bookings, cancellations, passenger information, and real-time updates. Efficient
database design ensures smooth operations, quick response times and a simple
user experience.
In this article, we will learn about How Database Design Essentials for a Railway
Reservation System by understanding various aspects of the article in detail.
CHOICE WINDOW
IF CHOICE IS 5 OR MORE
IF CHOICE IS 5 OR MORE
BIBLIOGRAPHY
• Website: https://www.w3resource.com
***