You are on page 1of 3

Ex.

No: 19 INTERFACING PYTHON WITH MYSQL


DATABASE CONNECTIVITY APPLICATION PROGRAM - INSERT RECORDS
AIM To write a database connectivity program in Python to establish connection to a MySQL database
‘SCHOOL’ and to do the following.
i)Create a table ‘student’ with the following fields
Rollno-integer(10), primary key, Name varchar(30) not null, Class char(3), Marks decimal(10,2)
ii) To insert the records into the table ‘student’
iii) To retrieve and display all the records stored into the table ‘student’
SOURCE
CODE

RESULT Thus a database connectivity program to create a table, to insert and display the records from the
table student has been created in Python and executed successfully.
Ex. No: 20 INTERFACING PYTHON WITH MYSQL
DATABASE CONNECTIVITY APPLICATION PROGRAM - UPDATE RECORDS
AIM: To write a database connectivity program in Python to establish connection to a MySQL database
‘SCHOOL’ and to do the following.
i) To update the records into the table ‘student’ for the given rollno
ii) To retrieve and display all the records stored into the table ‘student’
SOURCE
CODE:

RESULT Thus a database connectivity program to update and display the records from the table student has
been created in Python and executed successfully.
Ex. No: 21 INTERFACING PYTHON WITH MYSQL
DATABASE CONNECTIVITY APPLICATION PROGRAM - DELETE RECORDS
AIM: To write a database connectivity program in Python to establish connection to a MySQL database
‘SCHOOL’ and to do the following.
i) To delete the records from the table ‘Student’ for the given rollno
ii) To retrieve and display all the records who have secured marks in the range of 80 to 100 from
the table ‘Student’
SOURCE
CODE:

RESULT Thus a database connectivity program to delete and display the records from the table student has
been created in Python and executed successfully.

You might also like