Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Python MYSQL Practicals

Uploaded by

radha14622200
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Python MYSQL Practicals

Uploaded by

radha14622200
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment 9

Note the following to establish the connection between Python and MySQL:-

Host : localhost
Username : Admin
Password : Admin@123

The table exists in MySQL database as : Student

Consider the table Student whose fields are :-

Write the Python code to update grade to ‘A’ for all these students who are getting
more than 8 as points.

The table structure is as follows :


Scode : integer
Name : varchar
Age : integer
Strcde : integer
Points : integer
Grade : varchar

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

Given below is a table Item in 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

The table structure is as follows :


RollNo : integer
Name : varchar
Class : varchar
Percentage :float

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.

You might also like