Python MYSQL Practicals
Python MYSQL Practicals
Note the following to establish the connection between Python and MySQL:-
Host : localhost
Username : Admin
Password : Admin@123
Write the Python code to update grade to ‘A’ for all these students who are getting
more than 8 as points.
Write the Python code to update grade to ‘A’ for all these students who are getting
more than 4 as points.
Assignment 10
Note the following to establish the connection between Python and MySQL:
Host : localhost
Username : system
Password : test
Database : Inventory
Riya created this table but forget to add column ManufacturingDate. Can she add
this column after creation of table?
Assignment 11
Note the following to establish the connection between Python and MySQL:
Database : PythonDB
Table : Student
Host : localhost
User : root
Password : 1234
Write a code in python to create student table and insert atleast 5 records in the
table.
Write a code in Python to delete the record of a student whose rollno is 33. The
table structure is as follows.
Assignment 12
Note the following to establish the connection between Python and MySQL:
Host : localhost
Database : PythonDB
User : root
Password: myadmin
Table : College
Write a code in python to create college table and insert atleast 5 records in the
table.
What is the utility of fetchall() method? Write a code to fetch all the records of a
College table from PythonDB Database.