Program: WAP to Perform all the operations with reference to table ‘Employee’ through
MySQL-Python connectivity.
import [Link]
# Using connect method to connect database
db1 = [Link](host="localhost",user="root",passwd="mysql1234@2022"
,database="testdb");
# using cursor() method for preparing cursor
cursor = [Link]()
# Preparing SQL statement to create EMP table
sql = "CREATE TABLE EMP(empno integer primary key,ename varchar(25) not null,salary
float);"
[Link](sql)
# disconnect from server
[Link]()
# Inserting a record in ‘emp’
import [Link]
db1 = [Link](host="localhost",user="root",passwd="mysql1234@2022"
,database="testdb");
cursor = [Link]()
# Prepareing SQL statement to insert one record with the given values
sql = "INSERT INTO EMP VALUES (6,'NIKITA',98000);"
try:
[Link](sql)
[Link]()
except:
[Link]()
[Link]()