Page 31 - IPP-12-2024
P. 31

SECTION  E
              33.  Write suitable SQL queries for the following:
                  (i)  Returns the position of the substring “SUCCESS” from the given string “WORKING HARD IS THE ONLY
                     KEY TO SUCCESS, SHORTCUTS ARE FOR LOSERS”.
                 (ii)  Returns the string in upper case.
                 (iii)  To calculate the exponent for 5 raised to the power of -2.
                 (iv)  Return the current date and time.
                  (v)  To calculate the modulus of 35 and 45.                                             (5)
                                                           OR

                  Write SQL queries to perform the following task:
                 Table: Weather
                           DAY                MAX_TEMP                MIN_TEMP               FORECAST
                           Sun                    36                     24                Sunny and Hot
                          Mon                     34                     22                    Sunny
                           Tue                    30                     20                Dry and Cloudy
                          Wed                     32                     21                    Cloudy
                           Thu                    27                     16                     Rain
                           Fri                    30                     20                 Light showers
                           Sat                    32                     21                    Cloudy
                  (i)  To decrease the minimum temperature by 2 degrees.
                 (ii)  To add a new column TEMP_DIFF (difference of maximum and minimum temperatures) of integer type.
                 (iii)  Display the no. of days on the basis of forecast where forecast type ends with ‘dy’.
                 (iv)  Insert the records for TEMP_DIFF column, created in above query.
                  (v)  Find the average temperature throughout the week.
              34.  Korient Pvt Ltd, Noida has four blocks as shown in the below diagram and is now planning to set up a
                 network.

                                                      Korient Pvt Ltd
                                      FABRIC TESTING              QUALITY CONTROL
                                           BLOCK                        BLOCK

                                      MERCHANDISING
                                           BLOCK                    EDP / IT BLOCK

                  Distance between each block is given as follows:

                    BLOCK (from)        BLOCK (to)         DISTANCE
                                                          (in metre)
                  Merchandising     Fabric Testing            50
                  Merchandising     Quality Control           90
                  Merchandising     EDP / IT                 115
                  Fabric testing    Quality Control           40
                  Fabric testing    EDP / IT                  45
                  Quality control   EDP / IT                  25









            A.6    Informatics Practices with Python–XII
   26   27   28   29   30   31   32   33   34   35   36