cs project 12
cs project 12
cs project 12
Session(2024-25)
COMPUTER SCIENCE PROJECT ON
DATABASE CONNECTIVITY
ALL INDIA SR.SCHOOL CERTIFICATE EXAMINATION
AISSCE:2024-25
Date:
Teacher: Mr. Sudhir Naidu
Principal: Dr. Fr. Fabianus Minj
Summary
def search():
name = input("Enter the name to search: ")
cursor.execute("SELECT * FROM passengers WHERE name = %s", (name,))
result = cursor.fetchall()
if result:
for r in result:
print(r)
else:
print("No passenger found with that name.")
def displayall():
cursor.execute("SELECT * FROM passengers")
results = cursor.fetchall()
if results:
for r in results:
print(r)
else:
print("No passengers in the database.")
e = """
====================================================
WELCOME
INDIAN AIRWAYS
====================================================
"""
x = """
Choose the op on to proceed:
1. Add Informa on
2. Delete Informa on
3. Edit Informa on
4. Search Passenger
5. Display All Passengers
"""
print(e)
while True:
print(x)
op on = int(input("Enter your op on number: "))
if op on == 1:
inser on()
elif op on == 2:
dele on()
elif op on == 3:
upda on()
elif op on == 4:
search()
elif op on == 5:
displayall()
else:
print("Enter a valid op on!")
con = input("Do you want to con nue (yes/no): ").lower()
if con in ['yes', 'y']:
con nue
else:
print("Thank you for using Indian Airways!")
break
cursor.close()
conn.close()
OUTPUT:
ADD: EDIT:
DISPLAY: DELETE:
SEARCH: