Page 330 - IT 402 v2.0 class 10
P. 330

.   a   Structure of a table “Orders” is given below. Suggest suitable data type of each column
                                                      Ta le :  rders

                                    rder I       rder date     ostumer I       mount
                                    A_101        12/12/19        C3445         1200.00
                                    A_202        11/09/19        C1245         3456.00
                                    A_402        09/07/19        C2121         2312.00
               b    onsider the following table “ ooks”.

                        I                 ame                   ut or                Qty           Price
                      B_101      Learning with Fun    Jacobins                        5           355.00
                      B_103     How I Live Now        Meg  osoff                      4           400.00
                      B_104     I Capture the Castle  Dodie Smith                     5           520.00
                      B_106     Mortal Engines        Philip Reeve                    4           260.00
                      B_110     The Kite Rider        Geraldine McCaughrean           3           270.00
                 Write SQL queries to
                  i    isplay  ata of all books whose  uantity is more than  .
                  ii   isplay total amount of all books whose price is less than 5  .
                            int : amount    ty    rice
          ns.   a   Order_ID – Char
                 BkName – Varchar
                 Customer_ID – Char
                 Amount – Float
                 b    i   select * from books where qty>3
                  ii  select qty*price “Total Amount” from books price < 500
           3.  Consider the following table : STUDENT                                                      [2022]
                ADMNO        NAME        GRADE        DOB           MARKS          HOUSE        GENDER
                  1001    RUPAL             9      10/04/2006         76        GREEN              M
                  1002    RASHMI            9      08/12/2005         87        RED                 F
                  1003    ARNAV            10      25/05/2004         81        GREEN              M
                  1004    SUMONA            9      23/08/2005         68        RED                 F
                  1005    ARUN              9      16/07/2005         72        GREEN              M

                  1006    TIA               9      22/09/2005         91        BLUE                F
                  1007    ROSHAN           10      26/08/2004         89        BLUE               M
              Write SQL Commands:
               a    o display the details of all students of Green House.
               b    o increase the marks by 5 whose   MNO is    5.
               c     o display the details of all students whose M   S are less than   .
               d    isplay the list of all students in descending order of M   S.

          ns.   a   SE L E CT  *  F RO M  ST U D E NT  W H E RE  H O U SE  =  ' G RE E N' ;
               b   UPDATE STUDENT SET MARKS=MARKS+5 where ADMNO ="1005";
               c    SELECT * FROM STUDENT WHERE MARKS < 80;
               d   SE L E CT  *  F RO M  ST U D E NT  O RD E R B Y  M ARK S D E SC;
           4.  Create table EMPLOYEE                                                                       [2020]
               M I                    har
               M N M                  archar  5
                SI N                  archar
              SALARY                 Decimal


         328       Touchpad Information Technology-X
   325   326   327   328   329   330   331   332   333   334   335