Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 49 - Modular_V2.0_SQL_Flipbook
P. 49

    2.  Write the output of the following queries:

                            i.  SELECT A_name FROM ACCOUNT WHERE Address NOT IN ('Hyderabad', 'Bangalore');
                           ii.  SELECT A_no FROM TRANSACTION

                           iii.   SELECT COUNT(*),  SUM(Amount) FROM TRANSACTION  WHERE DOT <= '2022-06-01' AND
                               DOT >= `2022-10 -22'

                           iv.  Select count(*), Sum(Amount) from TRANSACTION Group By Type and having count > 2
                        3.  Differentiate between Group By and Order By clause?

                        4.  Explain the concept of Alias with the help of example.
                        5.  Differentiate between DATE, MONTH and YEAR functions.
                                                                                                   21 st  Century   #Collaboration
                     F.  Competency-based/Application-based question.                                  Skills  #Technology Literacy
                          Ananya has created a table of her five friends with their name, roll number and mark. Now, she wants to
                        add a new column Date of birth. Help her in doing so.

                                                            In the lab                     21 st  Century   #Technology Literacy
                                                                                               Skills
                                                                                                   #Productivity & Accountability
                       Consider the tables given below:
                       Table: ELECTRONICS

                                        Code        Item_name         Price          Colour         S_code
                                        S001       Mobiles            30000      Silver               P01
                                        S002       Refrigerator       20000      Cherry               P02
                                        S003       Colour TV          45000      Black                P03
                                        S004       Steamer             2000      White                P04
                                        S005       Coolers            50000      White                P05

                       Table: SELLER
                                                              S_code        S_name
                                                               P01       Mohan
                                                               P02       Sohan
                                                               P03       Kamal
                                                               P04       Rakesh

                       Write the output of the following queries.
                        (i)  To display Code, Item_name and S_name of all the Sellers, who manufacture "Steamers".
                        (ii)  To display Item_name, Code, S_name and Price of all the products whose Price >=30000
                         (iii) To display S_name and Item_name manufactured by vendor whose Code is "P01".

                      Teacher's Corner

                     1.  Discuss different types of functions with the students.
                     2.  Explain the concept of ORDER BY and GROUP BY commands.

                                                                                                                         47
                                                                                                        More on MySQL

| 44 45 46 47 48 49 50 51 52 53 54 |