Page 46 - C++
P. 46

(viii)  SELECT AVG(M_Price) FROM MobileMaster;
               Ans       (i)    SELECT  M_Compnay,  M_Name,  M_Price  FROM  MobileMaster

                                ORDER BY M_Mf_Date DESC;
                                  (½ mark for correct SELECT)

                                (½ mark for correct ORDER BY)

                         (ii)   SELECT * FROM MobileMaster WHERE M_Name LIKE „S%‟;
                                   (½ mark for correct SELECT)

                                 (½ mark for  correct WHERE clause)
                         (iii)   SELECT  M_Supplier,  M_Qty  FROM  MobileStock  WHERE  M_Id  <>

                                „MB003‟;
                                   (½ mark for correct SELECT)

                                        (½ mark for  correct WHERE clause)

                         (iv)   SELECT  M_Company  FROM  MobileMaster  WHERE  M_Price
                                BETWEEN 3000 AND 5000;

                                  (½ mark for correct SELECT)

                                  (½ mark for correct BETWEEN clause)


                         (v)
                                 M_Id                  SUM(M_Qty)

                                 MB004                 450

                                 MB003                 400
                                 MB001                 300

                                 MB006                 200

                                  (½ mark for correct output)


                         (vi)
                                 MAX(M_Mf_Date)            MIN(M_Mf_Date)

                                 2017-11-20                2010-08-21

                                (½ mark for correct output)


                         (vii)

                                 M_Id          M_Name         M_Qty         M_Supplier
                                 MB004         Unite3         450           New_Vision



                                                        Page No. 29
   41   42   43   44   45   46   47   48   49   50   51