Page 35 - IPP-12-2025
P. 35

36.  Consider the given dataframe df:                                                        [5]

                                  ID          Name          Subject        Marks          Date
                                  1            Arun          Maths           88        2025-01-12
                                  2            Priya        English          91        2025-02-10
                                  3            Kabir        Science          79        2025-03-15
                 Write Python statements for the dataframe df to:
                 (a)  Print the first two rows of the dataframe df.
                 (b)  Display the names of all graduates in the dataframe.
                  (c)  Add new column Result and set its value as 'Pass' for all the graduates.
                 (d)  Retrieve and display Name and Marks columns for graduates whose ID is less than 4.
                 (e)  Rename the column name Date to ExamDate.
             37.  Write suitable SQL queries for the following:                                           [5]
                 (a)  To display the average amount from Amount column (attribute) in SALES table.
                 (b)  To display the first seven characters from Buyer column (attribute) in Gadgets table.
                  (c)  To display Item column (attribute) from Items table after converting to lowercase.
                 (d)  To count the total number of unique material in Couture table.
                 (e)  To update the amount by adding 10% tax to each Amount in Budget table.
                                                           Or
                 (a)  Round off the value 590.316 to one decimal place.
                 (b)  Display the number of characters in string ‘Informatics Practices’.
                  (c)  Display the column Event_Name in lowercase of EVENTS table.
                 (d)  Display the first four characters of the string ‘Technology’.
                 (e)  Display the data from City column (attribute) in HOSTELLERS table after removing the leading and
                     trailing spaces.











































              P.8        Informatics Practices with Python–XII
   30   31   32   33   34   35   36   37   38   39   40