Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 37 - Modular_V2.0_SQL_Flipbook
P. 37

    Periodic Assessment-2

                                                            (Based on chapter 3)

                     A.   Write an SQL query to insert the following seven records into the Orders table:

                                        OrderID                   CustomerID                     Product

                                        Or11001                       C101                         Pen

                                        Or11002                       C102                        Pencil

                                        Or11003                       C103                        Eraser

                                        Or11004                       C104                    Geometry Box

                                        Or11005                       C105                        Marker

                                        Or11006                       C106                        Ruler

                                        Or11007                       C107                      Sharpener

                     B.   Fill in the blanks with the correct SQL operator used in the given scenarios:
                          1.  To check if the value of a is equal to b, use the …………………… operator.

                          2.  If you want to retrieve records where the price of a product is greater than any price from a subquery,
                              use the …………………… operator.

                          3.  To find products whose price is between 50 and 100, use the …………………… operator.

                          4.  If you want to check if a column value is part of a given list of values, use the …………………… operator.

                          5.  To search for products whose brand starts with the letter 'C', use the …………………… operator with a
                              pattern.

                          6.  To exclude records where the age of an employee is 28, use the …………………… operator.

                          7.  When you want to ensure that a product quantity is less than all quantities in another table, use the
                              …………………… operator.
                          8.  To find records  where  a condition is  met for any value in a subquery,  use the  ……………………
                              operator.

                                                                                                                         35
                                                                                                   Periodic Assessment-2

| 32 33 34 35 36 37 38 39 40 41 42 |