Page 18 - IPP-12-2024
P. 18

Ans.  import pandas as pd
                      s=pd.Series([95,89,92,95],index=['IP','Physics','Chemistry','Maths'])
                     print(s.index[1], s.index[3])
                 25.  Predict the output of the following:                                                    (2)
                      (i)  SELECT ROUND(POW(5,-3));
                     (ii)  SELECT MONTH("2019-01-05");
                 Ans.    (i)  0    (ii)  1
                                                           SECTION C

                 26.  The table given below shows the census data (2011) of different languages spoken in India. Based on the
                     SQL table Speakers, write suitable queries for the following:                            (3)
                                                         Table: Speakers

                                             Population                                  Growth_percentage
                          Language                               Speaker_percentage
                                          (Who Can Speak)                                   (1971–2011)
                      Urdu                    50772631                    4.19                   77.40

                      Bengali                 97237669                    8.03                  117.09
                      Hindi                  528347193                   43.63                  134.79

                      Punjabi                 33124726                    2.74                  160.59

                      Maithili                13583464                    1.12                  121.59

                      (i)  Display the total number of Bengali and Punjabi speakers.
                     (ii)  Which language is the most spoken language?
                     (iii)  Display the records in descending order of population.
                                                               OR
                     Predict the output of the following queries based on the table Speakers given above:
                      (i)  SELECT LEFT(LANGUAGE,3) FROM SPEAKERS

                         WHERE SPEAKER_PERCENTAGE < 5;
                     (ii)  SELECT COUNT(LANGUAGE) FROM SPEAKERS WHERE GROWTH_PERCENTAGE BETWEEN
                         70 AND 125;
                     (iii)  SELECT SUM(POPULATION) AS "TOTAL_POPULATION" FROM SPEAKERS;
                 Ans.    (i)  SELECT SUM(POPULATION) FROM SPEAKERS
                        WHERE LANGUAGE="BENGALI" AND LANGUAGE= "PUNJABI";
                                                               OR
                        SELECT SUM(POPULATION) FROM SPEAKERS WHERE LANGUAGE
                        IN("BENGALI","PUNJABI");
                      (ii)  SELECT LANGUAGE FROM SPEAKERS

                        WHERE POPULATION = (SELECT MAX(POPULATION) FROM SPEAKERS);
                      (iii)  SELECT * FROM SPEAKERS
                          ORDER BY POPULATION DESC;
                                                               OR
                       (i)    LANGUAGES            (ii)       COUNT             (iii)   TOTAL_POPULATION

                                  URDU                          3                          723,065,683
                                  PUN
                                  MAI


               MODEL TEST PAPER                                                                                 5
   13   14   15   16   17   18   19   20   21   22   23