RAJKIYA PRATHIBA VIKAS VIDYALAYA
DELHI – 110092
SESSION – 2024-25
COMPUTER PROJECT ON
EMPLOYEE MANAGEMENT
NAME:
CLASS :
CBSE ROLL NO :
CERTIFICATE
This is to certify that Cadet _____ CBSE Roll No: ______ has successfully
completed the project Work entitled Fitness Centre in the subject Computer Science
(083) laid down in the regulations of CBSE for the purpose of Practical
Examination in Class XII to be held in RPVV IP Extnension Patparganj Delhi -92
(Mr.Akant Sharma)
PGT Comp Science
Signature of External Examiner
Name: _______________________
Examiner Number:_______________
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely on
the encouragement and guidelines of many others. I take this opportunity to express
my gratitude to the people who have been instrumental in the successful completion
of this project.
I express my heartfelt gratitude to my parents for constant encouragement
while carrying out this project.
I gratefully acknowledge the contribution of the individuals who contributed in
bringing this project up to this level, who continues to look after me despite my flaws,
I express my deep sense of gratitude to the luminary The Principal, RPVV IP
Extension Delhi-92 who has been continuously motivating and extending their
helping hand to us.
My sincere thanks to Mr. Akant Sharma, Master In-charge, A guide, A Mentor
, who critically reviewed my project and helped in solving each and every problem,
occurred during implementation of the project
The guidance and support received from all the members who
contributed and who are contributing to this project, was vital for the success
of the project. I am grateful for their constant support and help.
CONTENTS
1) Introduction
2) System Requirements
3) Source code
4) Output
5) Bibliography
INTRODUCTION
SYSTEM REQUIREMENTS
1.Processor :
2.Disk Space :
3.Operating System :
4.Python Version :
5.Mysql Version :
SOURCE CODE
1. import mysql.connector as myc
2. from tabulate import tabulate
3. db=myc.connect(host='localhost',user='root',password='adi@230304',database='railw
ay')
4. cursor = db.cursor()
5. cursor.execute("create database railway")
6. cursor.execute("use railway")
7. cursor.execute("create table user(name varchar(20),`phone no` bigint,sex
varchar(10),password varchar(20),email varchar(50))")
8. cursor.execute("create table trains(`S.no`int primary key auto_increment,`train name`
varchar(30),`train no` int,origin varchar(30),destination varchar(30),`seats`
int,`coaches` int,`available` varchar(15),fare int)")
9. cursor.execute("create table bookings(name varchar(20),`phone no` bigint,sex
varchar(10),`train no` int,`train name` varchar(30),origin varchar(50),destination
varchar(50),status varchar(30),fare int )")
10.
11.
12. print()
13. print('''
14. Railway Reservation System
15.
16. 1.Station Master 2.User 3.Exit
17.
18. ''')
19. inp = int(input("Enter your choice :"))
20. if inp == 1:
21. inp1 = input("Enter the password:")
22. if inp1 == "ekant":
23. print("Welcome what you want to do ")
24. while True:
25. print('''
26. 1.User 4.Update train
27. 2.Trains 5.Add train
28. 3.Delete train 6.Exit
29. ''')
30. a=int(input("Enter your choice :"))
31. if a == 1:
32. cursor.execute("select * from user")
33. c=cursor.fetchall()
34. d=[]
35. for i in c:
36. d.append(list((i[0],i[1],i[2],i[4])))
37. h=["Name","Phone number","Sex","Email"]
38. table=tabulate(d,headers=h,tablefmt="simple")
39. print(table)
40. elif a == 2:
41. cursor.execute("select * from trains")
42. c = cursor.fetchall()
43. j = []
44. h = ["Train name", "Train number", "Origin", "Destination", "Fare"]
45. for i in c:
46. j.append(list(i))
47. table = tabulate(j, headers=h, tablefmt="simple")
48. print(table)
49. elif a == 3:
50. cursor.execute("select * from trains")
51. c=cursor.fetchall()
52. for i in c:
53. print(i,end="")
54. a = input("Serial number of train number you want to delete :")
55. cursor.execute("delete from train where `S.no`=%s",(a,))
56. print("Train deleted successfully")
57. elif a == 4:
58. while True:
59. a = input("Serial number of train number you want to update :")
60. print('''What you want to update
61. 1.Train name 5.Train seats 9.Exit
62. 2.Train number 6.Train coaches
63. 3.Train origin 7.Train running days
64. 4.Train destination 8.Train ticket fare
65. ''')
66. b=int(input("Enter your choice :"))
67. if b == 1:
68. new=input("Enter new name :")
69. cursor.execute("update train set `train name`=%s where `S.no`=%s",
(new,a))
70. elif b == 2:
71. new = int(input("Enter new number :"))
72. cursor.execute("update train set `train no`=%s where `S.no`=%s",
(new, a))
73. elif b == 3:
74. new = input("Enter new Origin :")
75. cursor.execute("update train set origin=%s where `S.no`=%s", (new,
a))
76. elif b == 4:
77. new = input("Enter new Destination :")
78. cursor.execute("update train set destination=%s where `S.no`=%s",
(new, a))
79. elif b == 5:
80. new = int(input("Enter new seats count :"))
81. cursor.execute("update train set seats=%s where `S.no`=%s", (new,
a))
82. elif b == 6:
83. new = int(input("Enter new count of caoches :"))
84. cursor.execute("update train set caoches=%s where `S.no`=%s",
(new, a))
85. elif b == 7:
86. new = input("Enter new running days of train :")
87. cursor.execute("update train set available=%s where `S.no`=%s",
(new, a))
88. elif b == 8:
89. new = int(input("Enter new name :"))
90. cursor.execute("update train set fare=%s where `S.no`=%s", (new,
a))
91. elif b == 9:
92. break
93. elif a == 5:
94. tr_name=input("Enter the train name:")
95. tr_no=int(input("Enter the train number:"))
96. tr_org=input("Enter the train origin:")
97. tr_dst=input("Enter the train destination:")
98. tr_seats=int(input("Enter the train seats:"))
99. tr_coaches=int(input("Enter the train coaches:"))
100. tr_available=input("Enter the days for running:")
101. tr_fare=int(input("Enter the train ticket fare in rupees:"))
102.
tupl=(tr_name,tr_no,tr_org,tr_dst,tr_seats,tr_coaches,tr_available,tr_fare)
103. q='insert into trains(`train name`,`train
no`,`origin`,`destination`,`seats`,`coaches`,`available`,`fare`) values(%s,%s,%s,%s,
%s,%s,%s,%s)'
104. cursor.execute(q,tupl)
105.
106. elif a== 6:
107. break
108. db.commit()
109. elif inp == 2:
110. while True:
111. print("Welcome To Our Railway Services")
112. print('''
113. 1.Login
114. 2.Signup
115. 3.Exit
116. ''')
117. inp1 = int(input("Enter your choice :"))
118. if inp1 == 1:
119. name = input("Enter your name:")
120. password = input("Enter your password:")
121. tup = (password,)
122. q = "select name,password from user where password=%s"
123. cursor.execute(q, tup)
124. c=cursor.fetchall()
125. d=c[0]
126. if name==d[0] and password==d[1]:
127. while True:
128. print('''
129. 1.Edit Profile 3.Cancellation
130. 2.Book Tickets 4.Logout
131. ''')
132. i=int(input("Enter your choice :"))
133. if i==1:
134. while True:
135. print('''
136. What you want to update
137. 1.Name 4.Email
138. 2.Phone Number 5.Password
139. 3.Sex 6.Exit
140. ''')
141. inp=int(input("Enter your choice :"))
142. if inp==1:
143. new=input("Enter new name to be changed:")
144. tupl=(new,password)
145. q = "update user set name=%s where password=%s"
146. cursor.execute(q, tupl)
147. print(f"Name has been updated as '{new}'")
148. elif inp==2:
149. new = input("Enter new phone number to be changed:")
150. tupl = (new, password)
151. q = "update user set `phone no`=%s where password=%s"
152. cursor.execute(q, tupl)
153. print(f"Phone number has been updated as '{new}'")
154. elif inp==3:
155. new = input("Enter Gender you want to change:")
156. tupl = (new, password)
157. q = "update user set sex=%s where password=%s"
158. cursor.execute(q, tupl)
159. print(f"Gender has been updated as '{new}'")
160. elif inp==4:
161. new = input("Enter new Email to be changed:")
162. tupl = (new, password)
163. q = "update user set email=%s where password=%s"
164. cursor.execute(q, tupl)
165. print(f"Email has been updated as '{new}'")
166. elif inp==5:
167. old=input("Enter your old password to confirm your
identity:")
168. name=input("Enter your name:")
169. if old==password:
170. new = input("Enter new password to be changed:")
171. tupl = (new,name)
172. q = "update user set password=%s where name=%s"
173. cursor.execute(q, tupl)
174. print(f"password has been updated as '{'*'* len(new)}'")
175. elif inp==6:
176. break
177. elif i==2:
178. cursor.execute("select * from trains")
179. c=cursor.fetchall()
180. j=[]
181. h=["S.no","Train name","Train
number","Origin","Destination","Seats","Coaches","Gender","Fare"]
182. for i in c:
183. j.append(list(i))
184. table=tabulate(j,headers=h,tablefmt="simple")
185. print(table)
186. cursor.execute("select * from user where password=%s",
(password,))
187. d=cursor.fetchall()
188. t=[]
189. for k in d[0]:
190. t.append(k)
191. a=input("Enter train number you want to book ticket:")
192. cursor.execute("select * from trains where `train no`=%s",(a,))
193. z=cursor.fetchall()
194. u=[]
195. for l in z[0]:
196. u.append(l)
197. new=u[5]-1
198. cursor.execute("update trains set seats=%s where `train no`=
%s",(new,a))
199. tupl=(t[0],t[1],t[2],u[2],u[1],u[3],u[4],"Booked",u[8])
200. q="insert into bookings values(%s,%s,%s,%s,%s,%s,%s,%s,
%s)"
201. cursor.execute(q,tupl)
202. print("Ticket booked successfully")
203. elif i==3:
204. cursor.execute("select * from bookings where name=%s",
(name,))
205. c=cursor.fetchall()
206. j=[]
207. for i in c:
208. j.append(list(i))
209. h=["Name","Phone no","sex","Train number","Train
name","Origin","Destination","Status","Fair"]
210. table=tabulate(j,headers=h,tablefmt="simple")
211. print(table)
212. a=input("which train ticket you want to cancel(train number) :")
213. cursor.execute("delete from bookings where `train no`=%s",
(a,))
214. print("ticket canceled succssfully")
215. elif i==4:
216. break
217. db.commit()
218. elif inp1 == 2:
219. name = input("Enter your name:")
220. phone = input("Enter your phone:")
221. sex = input("Enter you sex:")
222. password = input("Enter your password:")
223. email = input("Enter your email:")
224. tup = (name, phone, sex, password, email)
225. q = "insert into user values(%s,%s,%s,%s,%s)"
226. cursor.execute(q, tup)
227. print("User registered successfully")
228. db.commit()
229. elif inp1==3:
230. break
231. db.commit()
232. db.close()
OUTPUT
BIBLIOGRAPHY
Books :
Websites : https://www.youtube.com