Inserting a record in ‘emp’
import MySQLdb
db1 = MySQLdb.connect("localhost","root","","TESTDB" )
cursor = db1.cursor()
# Prepareing SQL statement to insert one record with the given values
sql = "INSERT INTO EMP VALUES (1,'ANIL KUMAR',86000);"
try:
cursor.execute(sql)
db1.commit()