assignment - 6
assignment - 6
Q-1
mycursor = connector.cursor()
while True:
agreement = input("do you want to input a new record into the table ? : ")
if agreement == "yes":
print("okay gentlemen")
agreement = input("do you want to increment marks of all students by 10% ? : ")
if agreement == "yes":
if agreement == "yes":
rollnumber = int(input("enter the rll number that you want to delete : "))
connector.commit()
myinput = input("do you want to once more execute the programme ? : ")
if myinput == "yes":
True
else:
break
if agreement == "yes":
for i in mycursor:
print(i)
output
Q-2
mycursor = connector.cursor()
while True :
if s == 1:
else:
pass
if s == 2:
else:
pass
if s == 3:
else:
pass
connector.commit()
s = int(input("Display the details of all items whose name starts with ‘C’ press 4 : "))
if s == 4:
for i in mycursor:
print(i)
else:
pass
s = int(input("Display the details of all items priced in the range of 100 to 150 press 5 : "))
if s == 5:
mycursor.execute("SELECT * FROM ITEM WHERE PRICE BETWEEN 100 AND 150 ")
agreement = input(("do you want to once more execute the programme ? : "))
if agreement == "yes":
pass
else:
break
connector.commit()
q-3
file_cursor = file_object.cursor()
while True:
if response == 1:
file_object.commit()
elif response == 2:
emp_num = int(input("enter the employee number of the employee of which you want to
change the name : "))
file_object.commit()
elif response == 3:
list_emp = file_cursor.fetchall()
for i in list_emp:
print(i)
elif response == 4:
name = input("enter the name of employee which you want to fetch : ")
emp = file_cursor.fetchone()
print(emp)
elif response == 5:
grade = file_cursor.fetchall()
print(grade)
else:
pass
if agreement == "yes":
pass
else:
break
output :
enter the employee number of the employee of which you want to change the name : 3
q-4
file_cur = file_obj.cursor()
while True:
if response == 1:
file_obj.commit()
elif response == 2:
file_obj.commit()
elif response == 3:
account_no = int(input("enter the acount number from which you want to withdraw : "))
file_obj.commit()
elif response == 4:
else:
pass
if agreement == "yes":
pass
else:
break
output :