You are on page 1of 1

Lab Assignment

Python –MySQL Connectivity


Empid- int
Ename- varchar(30)
Gender- char(1)
Mob- bigint
Basic- int
Address- varchar(50)
Table- EMP_DETAILS
Empid Ename Gender Mob Basic Address
101 Rajeev M 9865324516 50000 Ranchi
102 Ankit M 7979565612 65000 Bokaro
103 Sheetal F NULL 55000 Dhanbad
104 Mohit M 6004512456 60000 Ranchi

host- localhost
user- root
password- ops
database- Employees

1. Write a python connectivity script to display all records from Emp_Details table.
2. Write a python connectivity script to display the records of the employees whose
salary is greater than 50000 from Emp_Details table.
3. Write a python connectivity script to insert a record
(105, Sumit Kumar, M, 7878956213, 45000, Ranchi) into Emp_details table.
4. Write a python connectivity script to delete the record of the employee whose
employee Id is 102.

You might also like