CS Project ..
CS Project ..
Computer Science Lab of the School during the year 2024 – 2025.
Submitted for the ALL INDIA SENIOR SECONDARY CERTIFICATE EXAMINATION held
is absolutely genuine and does not contain of any plagiarized materials. The references
taken in this project have been declared at the end of this report.
Signature of Teacher-in-charge
With immense pleasure, I extent my heartfelt thanks to those who helped me to go a long
I am also highly indebted to our Computer Science Teacher, Mr. PADMANABHAN .R for
his guidance and constant support throughout the course of this project.
I am also thankful to my parents, the teaching and non – teaching staff of the school for their
timely help.
I also thank our management and our Principal Mr. KALANIDHI.M for providing the
infrastructure and other requirements essential in the successful completion of this project.
4 MySQL 9
5 OBJECTIVE 10
6 PYTHON SOURCECODE 14
7 MySQL DATABASE 31
8 OUTPUTS 33
9 BIBLIOGRAPHY 37
HARDWARES
◈.Desktop/laptop
◈.Mobile Phone
MySQL
A relational database stores data in separate tables rather than
putting all the data in one big storeroom. This adds speed and
flexibility. The SQL part of"MySQL" stands for "Structured Qucry
Language." SQL is the most common standardized language used to
access databases and is defined by the ANSI/ISO SQL Standard. The
SQL standard has been evolving since 1986 and several versions
exist. In this manual, " SOL-92" refers to the standard released in
1992, "SQL:1999* refers to the standard released in 1999, and
"SQL:2003"refers to the current version of the standard.
Administrative Functions;
The Admin Panel, a focal point of the system, equips administrators
with indispensable tools;
Add Train: Administrators can add new trains to the system,
specifying crucial details such as train number, name, origin,
destination, journey distance, journey time, seat availability, and
fares.
Update Train Details: The system allows administrators to modify
existing train details, adapting to dynamic demands and operational
changes. This includes updating seat availability, journey details, and
fare information.
Cancel Train: In response to operational constraints or changing
demands, administrators have the authority to cancel trains,
ensuring flexibility and adaptability in the system.
CLASS XII COMPUTER SCIENCE INVESTIGATORY PROJECT 2024-2025 10 | P a g e
2. Enhancing Customer Experience;
The Customer Panel is designed with the end-user in mind, focusing
on providing an intuitive and user-friendly interface for seamless
ticket booking and management.
User Interaction
User Login: The system provides a secure login interface for
registered users, requiring user ID and password for access.
Forgot User ID: Users can retrieve forgotten user IDs through their
registered email addresses, enhancing user experience and reducing
barriers to access.
4. dbo=con.connect(host="localhost",user="root",password="admin",database="train_
reservation")
5. co=dbo.cursor()
6. def new_user():
7. dbo=con.connect(host="localhost",user="root",password="admin",database="train_
reservation")
8. co=dbo.cursor()
9. import random
10. pid=random.randint(0,1000)*10
11. print("----------------------------------------------------------------------")
12. print(" \n Welcome to our reservation system \n Register Yourself here to use our
system")
('{}',{},'{}',{},'{}','{}')".format(uid,pid,name,pno,eid,pwd))
20. print("----------------------------------------------------------------------")
21. dbo.commit()
23. dbo=con.connect(host="localhost",user="root",password="admin",database="train_
reservation")
24. co=dbo.cursor()
27. emel=co.fetchall()
i. # old user id
31. dbo=con.connect(host="localhost",user="root",password="admin",database="train_
reservation")
32. co=dbo.cursor()
33. print("\n---------------------------------------------------------------\n")
36. b=co.fetchall()
37. c=len(b)
38. if c==0:
40. print("\n------------------------------------------------------------------\n")
45. if choose==1:
48. forgot_user_id()
50. new_user()
51. else:
54. n=co.fetchall()
55. for i in n:
56. if pas==(i[0]):
a. print("\n---------------------------------------------------------------\n")
c. passenger_panel(uid)
62. if out==1:
63. new_user()
65. old_user()
67. main_menu()
70. if password=="CLASS12CS":
72. print("---------------------------------------------------------------------")
73. admin_panel()
74. else:
PASSWORD************")
76. print("---------------------------------------------------------------------")
77. adminpassword()
i. #ADD TRAIN
79. dbo=con.connect(host="localhost",user="root",password="admin",database="train_
reservation")
80. co=dbo.cursor()
81. print("---------------------------------------------------------------------")
95. print("---------------------------------------------------------------------")
({},'{}','{}','{}',{},'{}',{},{},{},{},{},{},'{}')".format(a,b,c,d,e,g,h,i,j,k,l,m,n))
98. dbo.commit()
100.dbo=con.connect(host="localhost",user="root",password="admin",database=
"train_reservation")
101.co=dbo.cursor()
102.print("---------------------------------------------------------------------")
i. # To Update train no
120. if x==1:
121. print("---------------------------------------------------------------------")
format(tno,tname))
127. print("---------------------------------------------------------------------")
128. dbo.commit()
129. return
131. print("---------------------------------------------------------------------")
format(tname,tno))
137. print("---------------------------------------------------------------------")
138. dbo.commit()
139. return
141. print("---------------------------------------------------------------------")
format(orgn,tno))
147. print("---------------------------------------------------------------------")
148. dbo.commit()
149. return
151. print("---------------------------------------------------------------------")
format(td,tno))
157. print("---------------------------------------------------------------------")
158. dbo.commit()
159. return
161. print("---------------------------------------------------------------------")
163. tno=int(input("Enter train no whose journey dist you want to update: "))
167. print("---------------------------------------------------------------------")
168. dbo.commit()
169. return
171. print("---------------------------------------------------------------------")
format(tad,tno))
177. print("-----------------------------------------------------------------------")
178. dbo.commit()
179. return
181. print("---------------------------------------------------------------------")
format(tj,tno))
187. print("---------------------------------------------------------------------")
188. dbo.commit()
191. print("---------------------------------------------------------------------")
format(tsa,tno))
197. print("---------------------------------------------------------------------")
198. dbo.commit()
199. return
201. print("---------------------------------------------------------------------")
format(tss,tno))
207. print("---------------------------------------------------------------------")
208. dbo.commit()
209. return
211. print("---------------------------------------------------------------------")
213. tno=int(input("Enter train no whose no of seats in GEN you want to update: "))
format(tsg,tno))
217. print("---------------------------------------------------------------------")
218. dbo.commit()
219. return
221. print("---------------------------------------------------------------------")
223. tno=int(input("Enter train no whose fare price of ac you want to update: "))
format(tfa,tno))
227. print("---------------------------------------------------------------------")
228. dbo.commit()
229. return
231. print("---------------------------------------------------------------------")
233. tno=int(input("Enter train no whose fare price of SL you want to update: "))
237. print("---------------------------------------------------------------------")
238. dbo.commit()
239. return
241. print("---------------------------------------------------------------------")
243. tno=int(input("Enter train no whose fare price of GEN you want to update: "))
format(tfg,tno))
247. print("---------------------------------------------------------------------")
248. dbo.commit()
249. return
252. break
253. return
i. #CANCEL TRAIN
255. dbo=con.connect(host="localhost",user="root",password="admin",database=
"train_reservation")
256. co=dbo.cursor()
263. try:
264. print("---------------------------------------------------------------------")
271. if opt==1:
a. add_train()
a. update_details()
a. cancel_train()
b. print("---------------------------------------------------------------------")
c. main_menu()
277. except:
279. print("---------------------------------------------------------------------")
281. dbo=con.connect(host="localhost",user="root",password="admin",database=
"train_reservation")
282. co=dbo.cursor()
286. a=co.fetchall()
287. for i in a:
301. dbo.commit()
i. #BOOK TICKETS
303. dbo=con.connect(host="localhost",user="root",password="admin",database=
304. co=dbo.cursor()
307. co.execute(op)
308. r=co.fetchall()
310. print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
311. print("---------------------------------------------------------------------\n\n")
318. if typ==1:
train_no={}".format(trainno))
320. b=co.fetchall()
321. print(b[0][0])
train_no={}".format(trainno))
324. b=co.fetchall()
325. print(b[0][0])
train_no={}".format(trainno))
329. print(b[0][0])
335. j=random.randint(100000,999999)
337. cnf="Confirmed"
338. p=b[0][0]
('{}',{},{},'{}',{},'{}',{},'{}')".format(uid,j,trainno,cus1,age,gender,p,cnf))
340. p=b[0][0]
341. amt=tcktno*p
343. dbo.commit()
345. dbo=con.connect(host="localhost",user="root",password="admin",database=
"train_reservation")
346. co=dbo.cursor()
349. dbo.commit()
i. #PASSENGER PANEL
352. dbo=con.connect(host="localhost",user="root",password="admin",database=
353. co=dbo.cursor()
355. print("---------------------------------------------------------------------")
362. if choic==1:
363. Train_Search()
365. Book_Ticket(uid)
367. Cancel_Ticket()
369. main_menu()
371. print("---------------------------------------------------------------------")
i. #Panel functions
373. print("-----------------------------------------------------")
380. if ch==1:
381. adminpassword()
383. user_panel()
386. print("---------------------------------------------------------------------")
387. break
388. main_menu()
BOOKED TICKETS:
BOOOKING TICKETS: