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.
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 IF NOT EXISTS PRODUCT_SELECTION (
PRODUCT_ID INT AUTO_INCREMENT PRIMARY KEY,
PRODUCT_NAME VARCHAR(255),
__ _________ ___ __ _______ _____________ _______ _________ ________ ___________ ________ _________ _____________ ____________ ____________.
___________ _____________ _____________ _______ _______ ___________ ___________ _______ ____________.
_____ __________ _______ ______ ____ _________ ____________ ______ ____ _______ __________ _____ __.
_____________ ____ __ _________ ____ __ _____________ ____________ _______.
___ _____________ __________ _____ _____________ _____ __ _____________ _______ __ ______ ______ ____ _____________ ________.
_______ ______ _____ _____________ ________ ______ ____ _________ __ ______ ___.
___ ___________ ________ _____________ ____ _______ ___________.
___________ ____ ____ _________ _____________ ____________ _____ __________ ___________ _______.
_____________ __ ___________ _________ _____ ______ ________ _____.
_____________ ____________ __________ __________ ___ ________ ____ _____________ _______ ____ ________ __________.
_____________ _____ ________ _________ _______ _____________.
________ _________ ___ _____ _________ _______ ______ __ _________ __ ____________ ____ _________ __ _____________.
____ ____ ____ ___________ ___________ _______.
______ ___________ ______ _____ _____ __ _________.
_________ ____ _____ _________ ____________ _________.
___________ _____________ _____ ___________ _______ ____________ ______ ________.
_____ ___ _____________ ____ ____________ ______ _________ ___ ___ ______ ___ _______ __.
_______ ___________ _____________ _________ _____________ ____ _____.
___ ___________ ________ __ __ _________.
_____________ _____ __ _________ ____ ______ _____ ___.
_______ ______ _____ ___ __________ _______ ______ ___ __ __________ ________ ___________.
____________ __________ ____ ___ __ ___________ _______ ___ _________ ___ ___ __.
______ ___________ ___________ ________ _____________ ___________ ______ ____________ _____ ___ ____ ____________.
____________ __ ______ ________ ________ ___________ __ __.
______ _____________ ________ ______ ______ _____ _______ _____ ______ _____ _____________ ___ ___________ _____________.
___ __ _______ ___ _____________ ___ ______ ___ _______ _____________.
___________ _____ _________ _______ ______ ___ ___ _____________ _____.
___ __________ _______ _______ _____________ ____________ _______ ___ ________ ___ __ _______ _______.
__________ ___ ___________ _____________ _________ ______ ______ ___ ____________ ___________ _______ __.
______ __ __________ _______ ___________ _____ __________ _________ ______ ________ __________ ________.
__ ___________ _____ ____________ __ ______ ___________ _____ ____ __ _________ _____________ ____ __ ____________.
____ __ _________ _____ __________ _________.
____________ ______ _____________ _______ _______ __ _______ ____ _____.
________ _________ ______ _____ ____________ __________ __ _____ ___ ______.
__________ ________ ______ ____________ _____ ___ ___________ _____________ ____________ ________ __ _____________.
____________ ______ ___________ ______ _____________ _____________ ________ _____ ________ ___________ ____________ _________ __________.
_________ ______ ______ ____ ___________ _______ ___ ___ ___________.
______ ____________ __________ _____ ______ _____________ _____________ _________ ____ ________ ______ ____ _____ _____________.
____ ___ _____________ _____________ __________ ____________ _____ ____________.
_____ ____ __ ________ ______ ___________ ______ _________ ____ ____ ___ ________ ________.
_________ ___________ ____________ ______ _____________ __ ____ ____________ _____________ ________.
_________ ____ _____ _____________ __________ ______ ___________ ___ ________ ___ _________ _____ __ _______ ___.
________ _________ ___ ________ __ ____________ ____ ___ ___ ___ ___ _________ ___.
__________ _________ _____ ______.
Click Here to Order Full Assignment on WhatsApp
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.
Using Structures write an interactive program in C language to create an application
program for a small school to maintain the Student_’s database. This application should
be having menu options like (10 Marks)
• Creating a New Record
• Reading/Listing of Records
• Modify the record
•Delete the record
Each Student_ record should have Student_Name, Student_Roll_No., Student_Class, Student_Fees, Date of Admission, etc.). The application should be designed user-friendly.
Write program in C, for the following :
a) To find the sum of digits in an N digit number entered by the user, and print weather the final sum of digits is even or odd
b) To replicate strcpy() function of string.h header file
c) To convert decimal number enetered by the user into its equivalent Binary number.
d) To find the Largest and Smallest number in an unsorted array of integers, entered by the user.
e) To find count vowels and consonants present in any sentence entered by the user
Download any Dataset, then write a python code to read the downloaded dataset of your choice (April be CSV file) and print all features i.e. columns of the dataset. Determine the descriptive statistics i.e. Mean Median, Maximum, Minimum ,Range, Count, Variance, Standard Deviation etc. of the numeric features like age, marks, income etc., which April be present in the dataset.
Click to Contact Us
Call - 9199852182 Call - 9852900088 myabhasolutions@gmail.com WhatsApp - 9852900088