Project Library
Project Library
'''
'''
# Code for creating database- library [Must be executed only ONCE]
'''
# Code for creating table - book in the database- library [Must be executed only ONCE]
mycur=mycon.cursor()
else:
print("\t\t\t Record NOT found..!!!")
# function to delete book record
def deletebook():
bno=int(input("Enter book number to be deleted...:"))
qry="SELECT * FROM book WHERE bno=%s"
rec=(bno,)
mycur.execute(qry,rec)
data=mycur.fetchall()
count=mycur.rowcount
if count!=0:
print("\t\t Book Records found.........:\n")
for (bno,bname,bauth,bprice,bqty) in data:
print("Book Code:\t",bno)
print("Book Name:\t",bname)
print("Book Author:\t",bauth)
print("Book Price:\t",bprice)
print("Book Quantity:\t",bqty)
print(".................................")
else:
print("\t\t\t Record NOT found..!!!")
if count!=0:a
print("\t\t Book Records found.........:\n")
for (bno,bname,bauth,bprice,bqty) in data:
print("Book Code:\t",bno)
print("Book Name:\t",bname)
print("Book Author:\t",bauth)
print("Book Price:\t",bprice)
print("Book Quantity:\t",bqty)
print(".................................")
else:
print("\t\t\t Record NOT found..!!!")