Page 50 - Modular_V2.0_SQL_Flipbook
P. 50

Periodic Assessment-3

                                                         (Based on chapter 4)


              A.    Match the following:
                    1.  COUNT()                        a.  Finds the minimum value in the given set of values.

                    2.  AVG()                          b.  Returns the sum of values under a specific column.
                    3.  MAX()                          c.  Finds the average of any numeric field in the table.

                    4.  MIN()                          d.  Counts the number of records or values in a specified column.
                    5.  SUM()                          e.  Returns the maximum value in the given set of values.


              B.    Perform the following tasks using the given PRODUCTS table:

                           Product_id      Product_name        Category            Price            Stock

                              P101             Laptop         Electronics         50000               15

                              P102             Mobile         Electronics         20000               30

                              P103             T-shirt          Clothing             800              50

                              P104             Shoes            Clothing            1500              20

                              P105            Camera          Electronics         30000               10

                    1.  Write an SQL query to find the number of products in each Category. Use the COUNT() function
                        along with the GROUP BY clause.


                        …………………………………………………………………………………………………………………………………………………………

                        …………………………………………………………………………………………………………………………………………………………

                    2.  Write an SQL query to retrieve the Product_name, Price, and Stock for all products, ordered by
                        Price in ascending order.


                        …………………………………………………………………………………………………………………………………………………………

                        …………………………………………………………………………………………………………………………………………………………


              C.    Guess Who I am?

                    1.  I convert the string you give me into lowercase.                                  ……………………

                    2.  I return the remainder when one number is divided by another.                     ……………………

                    3.  I return the square root of a given number.                                       ……………………
                    4.  I return the current date and time based on the system clock.                     ……………………

                    5.  I return the value of one number raised to the power of another.                  ……………………


                48
                      Touchpad MODULAR (Ver. 2.0)
   45   46   47   48   49   50   51   52   53   54   55