0% found this document useful (0 votes)
2 views1 page

Python Interface With MySQL Worksheet-2

The document provides a worksheet for Grade 12 students at Our Own High School, Dubai, focusing on Python programming with MySQL. It includes two tasks: one for displaying student records with fees over 5000 from a 'Student' table and another for updating item quantities in a 'Shop' table. Connectivity details for MySQL databases are also specified for both tasks.

Uploaded by

fbi893118
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Interface With MySQL Worksheet-2

The document provides a worksheet for Grade 12 students at Our Own High School, Dubai, focusing on Python programming with MySQL. It includes two tasks: one for displaying student records with fees over 5000 from a 'Student' table and another for updating item quantities in a 'Shop' table. Connectivity details for MySQL databases are also specified for both tasks.

Uploaded by

fbi893118
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OUR OWN HIGH SCHOOL, DUBAI

Python Interface with MySQL - Worksheet-2


Grade-12

1. Sartaj has created a table named Student in MySQL database SCHOOL.

• rno: Roll number (Integer)


• name: Name of the student (String)
• DOB: Date of birth (date)
• Fee: Tuition Fee (Integer)

Consider the following to establish connectivity between Python and MySQL:


• Username: root
• Password: tiger
• Host: localhost

Sartaj, now wants to display the records of students whose fee is more than 5000. Help Sartaj to write
the program in Python.

2. Sumit wants to write program in Python to update the quantity to 20 of the records whose item code
is 111 in the table named Shop in MySQL database name Keeper.

The table Shop in MySQL contains the following attributes:


• Item_code: Item Code (Integer)
• Item_name: Name of Item (String)
• Qty: Quantity of item (Integer)
• Price: Price of item (Integer)

Consider the following to establish connectivity between Python and MySQL:


• Username: admin
• Password: shopping
• Host: localhost

You might also like