Question

Write Program to perform following tasks (10 Marks)
a. Create a database PRODUCT_SELECTION_DB
b. Set connection with mysql.connector.connect.

c. Create a table PRODUCT _SELECTION in database PRODUCT_SELECTION_DB with
following data PRODUCT_NAME,PRODUCT_PRICE, MANUFACTURER, EXPIRY_DATE.
d. change table structure / (add, edit, remove column of a table) at run time
i. add a column address in the PRODUCT_SELECTION table.
ii. execute SQL INSERT statement to create a record into PRODUCT _SELECTION table
iii. run the query to updates all the records having EXPIRY_DATE as 31-Dec-2022 and
increase PRICE of all the PRODUCTS by 10% of PRODUCT_PRICE.
iv. delete all the records from PRODUCT _SELECTION Table where EXPIRY_DATE is
before 31-Dec-2022.

30 Nov 2023
Answer :
Word Count : 452

Below are Python programs to accomplish the tasks outlined using the `mysql.connector` module for database interaction and SQL queries:

```python
import mysql.connector

# Establishing connection to MySQL
try:
    connection = mysql.connector.connect(
        host="your_host",
        user="your_username",
        password="your_password",
        database="PRODUCT_SELECTION_DB"
    )

    cursor = connection.cursor()

    # Creating a table PRODUCT_SELECTION in database PRODUCT_SELECTION_DB
    create_table_query = """
    CREATE TABLE ___ _________ _________ _______ __________ ______ ______ ___.
______ _______ ___ ___ __________ ____.
________ _____ __________ ________ _________ __________ ________ _________ _________ _____.
_________ ______ _________ _____ ___ _________ ____.
____ ___ ______ _________ ____ _____ _______ ____ ___.
_________ _______ _______ _________ _________ _______ ________ ________ _____ __________.
_______ ____ __________ ______ _______ ____ __________.
_____ _____ _________ ______ ________ ___ ___ _______ __________ ______ ______ _________.
____ __________ _______ ____ ____ _________ ___ _____.
_______ ______ ________ _________ __________ _______ _______.
________ _________ ____ ________ _______ _______.
_______ ____ ________ ______ ______ _____ ________ __________ ________ ____ _____ ___.
___ __________ _________ _______ _______ _______ ___.
___ __________ ___ ____ ____ ________ __________ ____ _______.
_______ _______ _____ ______ ___ ________ __________.
________ _______ ___ _______ _____.
_________ ____ ________ ______ __________ ___ ____ ___.
_________ ________ _________ _____ ___ _________ _____ _____ ___.
___ _________ ___ ________ ______ ________ ________ ______ ______ _____.
_____ _____ _______ _______ ___.
________ __________ _______ ___ _________ _________ __________ ________ _____ ___ _____ __________.
_______ _____ _______ ____ ______ _____ _____ ____ _______ __________ __________ ________.
______ ______ ________ _____ ________ ____.
_____ __________ _________ ___ ________ __________ __________ ___ _____ _________ _________ ____.
______ _________ ____ ___ _______ ___.
___ ____ _________ _________ ___ __________ _________ _________.
__________ _______ ________ _______ _______ _________ ____ _______ ___ ________ _______ _________.
_______ __________ _______ __________ _________ ___ ________ ____ ___ ______.
_______ _______ ______ ________ _____ ________ _______.
______ ______ _____ __________ ______ ________ ___ ______ _________.
_______ ______ ____ _____ _____ ___.
________ ___ _________ ___ _________ ___ ________ _________ _________.
__________ _______ _____ _________ _______ ___ ___.
______ ________ ________ ___ ________ _________ _______ __________.
_________ ___ _______ _________ ___ ________ _____ _________.
_________ ______ ________ ______ ____ ____ ____ ____ ________ ______ ________ __________.
_____ ________ ____ _______ ____ _______ _____ __________.
_______ ____ ___ ___ _________.
________ ____ _________ _________ _________ ___.
__________ _____ ____ ______ _________ ________ _______ _____ __________ __________ __________.
___ ________ ______ _____ ________ ________.
______ _________ __________ ____ ________ __________ ______ _____ _______ _________.
__________ ______ _________ _________ __________ _____ __________ _____ ___ ________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write Program to perform following tasks (10 Marks)a. Create a datab
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→