Page 20 - IPP-12-2024
P. 20
(b) Report the incident to a local law enforcement cell (cybercell) and file a formal complaint.
OR
The following measures that need to be adopted to manage digital footprints are:
(a) Keep all the software up to date.
(b) Create a strong, easy-to-remember password, which is a combination of numbers, symbols,
uppercase and lowercase letters.
(c) Double-check privacy settings. Don’t trust unsafe websites.
30. Consider a given DataFrame 'df': (3)
DEPTH(km) COMPOSITION
0 20 Solid rock, granite, basalt
1 150 Soft slow flowing material
2 2000 Hot but solid material
3 4000 Molten iron and nickel
Write suitable Python statements for the following:
(i) Add a column called "NAME_OF_LAYER" to the following data:
["CRUST", "ASTHENOSPHERE", "MANTLE", "OUTER CORE"].
(ii) Add a new row having "DEPTH" = 6000, "COMPOSITION" = "Solid iron and nickel" and "NAME_OF_
LAYER"= "Inner Core".
(iii) Rename the column "NAME_OF_LAYER" to "LAYER".
Ans. (i) df["NAME_OF_LAYER"]=["CRUST", "ASTHENOSPHERE",
"MANTLE", "OUTER CORE"]
(ii) df.loc[4]=[6000, "Solid iron and nickel", "INNER CORE"]
(iii) df=df.rename({"NAME_OF_LAYER":"LAYER"}, axis="columns")
OR
df=df.rename({"NAME_OF_LAYER":"LAYER"}, axis=1)
SECTION D
31. The DBA of a product-based company created a table named "ORGANIC". Assist him by writing the following
queries: (4)
Table: ORGANIC
Customer_id Manuf_date Exp_date Quality Quantity Customer_type
121 2023-12-15 2025-12-15 A 250 UK
123 2022-02-09 2024-02-09 A 200 International
132 2017-09-10 2019-03-10 B 400 Business
128 2019-01-05 2020-07-05 B 300 Group
111 2023-01-15 2025-01-15 A 800 Business
(i) Write a query to display the type of customers whose order quantity is less than or equal to 200.
(ii) Write a query to display the month of the most recent manufacturing date.
(iii) Write a query to display manufacturing date and expiration date having quantity greater than 500.
(iv) Write a query to count the total number of customers who bought "A" quality product.
Ans. (i) SELECT CUSTOMER_TYPE
FROM ORGANIC
WHERE QUANTITY <= 200;
(ii) SELECT MONTH(MAX(MANUF_DATE)) FROM ORGANIC;
(iii) SELECT MANUF_DATE,EXP_DATE
FROM ORGANIC
WHERE QUANTITY>500;
MODEL TEST PAPER 7