Page 9 - IPP-12-2025
P. 9
Ans. import pandas as pd
stat_data = {
'Item': ['Pen', 'Pencil', 'Eraser', 'Sharpener'],
'Price': [10, 5, 7, 15],
'Stock': [100, 200, 150, 80]
}
df = pd.DataFrame(stat_data)
print(df)
Or
import pandas as pd
data = {'Kiwi': 50, 'Dragon Fruit': 30, 'Blueberry': 45}
s1 = pd.Series(data)
print(series)
31. (a) Write an SQL statement to create a table named ACTIVITIES with the following specifications: [2+1]
ActivityID (Primary Key, Varchar), Name (Varchar(50)), Duration (Integer(No. of weeks)), Charges
(Integer), Coach_Name(Varchar(30)).
(b) Write an SQL query to insert the following data in ACTIVITIES table:
'AT1001', 'Abacus', 4, 4500, 'Ms.Swati'
Ans. (a) CREATE TABLE ACTIVITIES
(
ActivityID VARCHAR PRIMARY KEY,
Name VARCHAR(50),
Duration INTEGER,
Charges INT,
Coach_Name Varchar(30)
);
(b) INSERT INTO ACTIVITIES VALUES ('AT1001', 'Abacus', 4, 4500, 'Ms. Swati');
32. Consider the following tables: [3]
Table 1:
CUSTOMERS, which stores Customer ID (Cust_ID), Customer Name (Name) and Address (Address),
Contact Number (Contact_No)
Table 2:
ORDERS, which stores Order ID (Order_ID), Customer ID (Cust_ID), Amount (Amount)
Note: The names of the attributes are written within brackets.
Table: CUSTOMERS
Cust_ID Name Address Contact_No
2101 Mohit Singh Ashok Vihar 1891456723
2102 Meghna Sharma Pitampura 1965345642
2103 Renu Gupta Shalimar Bagh 1896052121
2104 Charvi Jain Shalimar Bagh 1876451243
2105 Vansh Chawla Ashok Vihar 1800764551
M.6 Informatics Practices with Python–XII