How to update a record in a table

import mysql.connector
con=mysql.connector.connect(host='localhost',user='root',password='silan', database='silandb')
obj=con.cursor()
#Update Operation
sql="update employee set esal=90000 where ename='Sreedha'"
obj.execute(sql)
con.commit()
print("row updated")


Output:

After updating, if we will run the following SQL statement in MySQL environment Select * from silandb.employee then we will get the following updated output.



 PreviousNext