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

Python Interface With MySQL Worksheet-1

The document provides instructions for two programming tasks involving Python and MySQL. Sunil needs to insert item details into a 'Shop' table in the 'Keeper' database, while Kabir needs to insert student records into a 'Student' table in the 'SCHOOL' database. It includes details on the database structure and connectivity parameters 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)
4 views1 page

Python Interface With MySQL Worksheet-1

The document provides instructions for two programming tasks involving Python and MySQL. Sunil needs to insert item details into a 'Shop' table in the 'Keeper' database, while Kabir needs to insert student records into a 'Student' table in the 'SCHOOL' database. It includes details on the database structure and connectivity parameters 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-1


Grade-12

1. Sunil wants to write program in Python to insert the following details into the table named Shop in
MySQL database name Keeper.

Item Code: ‘I002’, Item Name: ‘Samsung TV’, Quantity: 10, Price: 20000

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

2. Kabir wants to write program in Python to insert the following record in the 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

The values of fields rno, name, DOB and fee has to be accepted by the user. Help Kabir to write the
program in Python.

You might also like