Page 43 - IPP-12-2025
P. 43
36. Consider the dataframe df shown below. [5]
StudentID Name Class Marks Age
0 1 Ankit 12 85 17
1 2 Priyanka 11 89 16
2 3 Rahul 12 92 18
3 4 Riddhima 10 78 15
4 5 Jayshree 11 88 16
Write Python statements for the dataframe df to:
(a) Print the first three rows of the dataframe df.
(b) Display the names of all the students in the dataframe.
(c) Add a new column, ‘Sports’, and set its value as ‘Basketball’ for all students.
(d) Retrieve and display ‘Name’ and ‘Marks’ columns for students in Class 11.
(e) Rename the column name ‘Marks’ to ‘Percentage’.
37. Write a suitable SQL query for the following: [5]
(a) To calculate the total price from price column (attribute) in Orders table.
(b) To display the first five characters from product_code column (attribute) in Products table.
(c) To display email column (attribute) from Customers table after converting all characters to
lowercase.
(d) To find the minimum value in marks column (attribute) of Students table.
(e) To count the total number of unique order_ids in OrderDetails table.
Or
Write suitable SQL query for the following:
(a) Round off the value 456.789 to one decimal place.
(b) Calculate the remainder when 144 is divided by 12.
(c) Display the number of characters in the string ‘InformationEncrypted’.
(d) Display the last 7 characters from the string ‘Technology Space’.
(e) Display the data from ‘address’ column (attribute) in ‘Customers’ table after removing the trailing
spaces.
P.16 Informatics Practices with Python–XII