Page 163 - C++
P. 163

Q5 (a) Observe the following table and answer the parts(i) and(ii) accordingly.                      (2)

        Table: Product

        Pno       Name        Qty       PurchaseDate

        101       Pen         102       12-12-2011
        102       Pencil      201       21-02-2013

        103       Eraser      90        09-08-2010

        109       Sharpener  90         31-08-2012
        113       Clips       900       12-12-2011



         (i) Write the names of most appropriate columns, which can be considered as candidate keys.

         (ii) What is the degree and cardinality of the above table?

        (b) Consider the following tables SCHOOL and ADMIN  and answer (a) and (b) parts of this question :  (4+2)



































        (a) Write SQL statements for the following:

        (i) To display TEACHERNAME, PERIODS of all teachers whose periods are more than 25.
        (ii) To display all the information from the table SCHOOL in descending order of experience.
        (iii) To display DESIGNATION without duplicate entries from the table ADMIN.

        (iv) To display TEACHERNAME, CODE and corresponding DESIGNATION from tables SCHOOL and ADMIN of
        Male teachers.
   158   159   160   161   162   163   164   165   166   167   168