All India Senior School Certificate Examination 2023-24
Practical Examination - Computer Science (083)
SET 4
Time: 3:00 Hours Max. Marks: 30
Q 1. a) Write a menu drive program to perform the following operations into [Link].
1. Add record.
2. Display records
3. Search record
4. Exit
The structure of file content is: [s_id, name, brand, type, price]
b) Consider the table given below and write the sql queries based on the table data 4
Table Name : Trainer
a. Display the details of the trainer who joined before june 2001 and after dec2001
b. Display the name and salary of the trainer who belongs to Mumbai and Delhi
c. Increase the salary by 5% for the trainers who’s name ends with A and from Mumbai
d. To display total number of trainers whose salary is more than 75000.
Q2. Practical Report File 7
Q3. Project 8
Q4. Viva Voce 3
Solution:
import csv
def add_record():
f1=open("[Link]",'r')
ro=[Link](f1)
l=list(ro)
f=open("[Link]",'a',newline='')
wo=[Link](f)
if len(l)==0:
[Link](['Subscriber ID','name','brand','customer type','Price'])
else:
s_id=int(input("Enter Subscriber ID:"))
name=input("Enter name of subscriber:")
brand=input("Enter brand of telephone:")
typ=input("Enter customer type:")
price=float(input("Enter Price:"))
[Link]([s_id,name,brand,typ,price])
print("Record addedd Successfully.")
[Link]()
def display_record():
f=open("[Link]",'r')
ro=[Link](f)
l=list(ro)
for i in range(1,len(l)):
print(l[i])
[Link]()
def search_record():
f=open("[Link]","r")
ro=[Link](f)
sid=input("Enter id to search:")
found=0
for i in ro:
if sid==i[0]:
found=1
print("Record Found:")
print(i)
if found==0:
print("Record not found...")
[Link]()
def menu():
while True:
print('''
1. Add record
2. Display record
3. Search record
4. Exit
''')
ch=int(input("Enter your choice:"))
if ch==1:
add_record()
elif ch==2:
display_record()
elif ch==3:
search_record()
elif ch==4:
print("Over and exit!!")
break
else:
print("Invalid Choice")
menu()
SQL
a. Display the details of the trainer who joined before june 2001 and after dec2001
b. Display the name and salary of the trainer who belongs to Mumbai and Delhi
c. Increase the salary by 5% for the trainers who’s name ends with A and from Mumbai
d. To display total number of trainers whose salary is more than 75000.