Set B
Set B
INFORMATICS PRACTICES(065)
CLASS XII
MM-30 Set-B TIME:3 hrs.
Q.1
i. Observe the following dataframe code: (5)
import pandas as pd
dt={'Name':['Akshit','Bharat','Chetan','Dhaval','Gaurang'],
'InternalMarks':[18,19,20,18,19],
'AnnualExam':[76,78,80,76,73]}
df=pd.DataFrame(dt)
print(df)
a) Write the output of the following code.
b) Add record of a student with details [“Mohit”, 20, 75].
c) Add a column “Section” with values [“A”,”B”,”B”,”A”,”C”,”A”].
d) Rename a column named “AnnualExam” to “BoardExam”.
e) Rename index as [101,102,103,104,105] .
ii. Mrs. Namrata is a coordinator in the senior section school. She represented data on Enrollment in line
chart as follows: (3)
Q.2 Write SQL commands for (a) to (d) and write the output of (e) and (g). (7)
Table : Bank
(a) Display Bank_id Cust_name Bank_name Amount transaction
details of those
customers 1 Amit State Bank 20000 25
whose 2 Sunil Union Bank 25000 20
transactions are
more than 20. 3 Nidhi UCO Bank 18000 15
(b) 4 Ashish Union Bank 10000 22
5 Suman State Bank 18500 8
Display Customer Name and Amount of all the customers of State Bank.
(c) Display the total number of customers of Union Bank.
(d) Display details of customers whose name contains ‘i’.
(e) Select sum(Amount) from Bank;
(f) Select count(*) from Bank;
(g) Select max(Amount), Bank_name from Bank group by Bank_name;