CBSE Class 12 Computer Science
Question 34 of 47
Interface Python with SQL — Question 12
Back to all questionsimport mysql.connector
mydb = mysql.connector.connect(host = "localhost",
user = "root",
passwd = "tiger",
database = "School")
mycursor = mydb.cursor()
mycursor.execute("UPDATE employee SET salary = salary + 3000 WHERE Ename = 'MANOJ KUMAR'")
mydb.commit()