Page 26 - IPP-12-2025
P. 26

Ans.  (a)  print(df1.head(4))
                 (b) print(df1['Name'])
                  (c) df1['Subject'] = "IT"
                 (d) print(df1[df1['Class'] == 12][['TeacherName', 'Experience']])
                 (e) df1.rename(columns={'Experience': 'Experience(in years)'}, inplace=True)
             37. Write suitable SQL queries for the following:                                             [5]
                 (a) To calculate the average marks from marks column (attribute) in Practicals table.
                 (b) To display the first eight characters from Item_Name column (attribute) in Items table.
                  (c) To  display  Fabric_Type  column  (attribute)  from  Fabrics  table  after  converting  all  characters  to
                     lowercase.
                 (d) To find the maximum value in stock_qty column (attribute) of Stocks table.
                 (e) To count the total number of unique city in Projects table.
                                                           Or
                 (a) Round off the value 178.251 to two decimal points.
                 (b) Calculate the remainder when 154 is divided by 7.
                  (c) Display the string ‘CaptivatingPerformance’ in uppercase.
                 (d) Display the first 5 characters from the string ‘Festive Vibes’.
                 (e) Display  the  data  from  Recharge  column  (attribute)  in  Mobiles  table  after  removing  the  leading
                     spaces.
            Ans.  (a)  Select Avg(marks) from Practicals;
                 (b) Select Left(Item_Name, 8) from Items;
                  (c) Select Lcase(Fabric_Type) from Fabrics;
                 (d) Select Max(stock_qty) from Stocks;
                 (e) Select Count(Distinct city) from Projects;
                                                           Or
                 (a) Select Round(178.251,2);
                 (b) Select Mod(154,7);
                  (c) Select Upper('CaptivatingPerformanceypted');
                 (d) Select Left('CaptivatingPerformnce');
                 (e) Select Ltrim(Recharge) from Mobiles;






































            M.23         Informatics Practices with Python–XII
            42
   21   22   23   24   25   26   27   28   29   30   31