Python-MySQL
Interface
[Link]: 24(1)
(1)
CREATING A PYTHON PROGRAM TO INTEGRATE MYSQL WITH PYTHON
(INSERTING RECORDS AND DISPLAYING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python by inserting records to
Emp table and display the records.
SOURCE CODE:
Result:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
Python Executed Program Output:
SQL OUTPUT:
[Link]: 24(2)
(2)
CREATING A PYTHON PROGRAM TO INTEGRATE MYSQL WITH PYTHON
(SEARCHING AND DISPLAYING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python to search an Employee
using EMPID and display the record if present in already existing table EMP, if not
display the appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
Python Executed Program Output:
RUN -1:
Run – 2:
SQL OUTPUT:
OUTPUT -1:
OUTPUT -2:
Exp:24
(3)
(UPDATING RECORDS)
AIM:
To write a Python Program to integrate MYSQL with Python to search an Employee
using EMPID and update the Salary of an employee if present in already existing
table EMP, if not display the appropriate message.
SOURCE CODE:
Result:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
Python Executed Program
Output: RUN -1:
Run -2:
SQL OUTPUT: