'''Write a python program to integrate SQL with python
by importing the MYSQL module to update the employee record of entered
empno.'''
[Link]
con=[Link](host='localhost',user='root',
password='admin',database='geetha')
cur=[Link]()
print("EMPLOYEE SEARCHING FORM")
ans='y'
[Link]()=='y':
eno=input("Enter Employee Number to be updated:")
query="select * from employee where eno={}".format(eno)
[Link](query)
result=[Link]()
[Link]==0:
print("Sorry!Empno not found")
else :
print("%12s"%"EMPNO","%20s"%"NAME","%15s"%"Esal")
for row in result:
print("%10s"%row[0],"%23s"%row[1],"%15s"%row[2])
choice=input("\nAre you sure you want to update?(Y):")
[Link]()=='y':
print("==You can update details==")
d=input("Enter new salary:")
if d=="":
d=row[2]
query="update employee set Esal={} where eno={}".format(d,eno)
[Link](query)
[Link]()
print("Record Updated")
ans=input("Do you want to update more?(y):")
query="select * from employee"
[Link](query)
for i in cur:
print(i)
OUTPUT :