Page 55 - IP
P. 55

PREBOARD
       EXAMINATION

       (e)What is the purpose of following MySql Command:                                                                               2
        SELECT MAX (salary) FROM EMP;
       (f)A table “Customer” in database 5 columns and no rows in it. What is its cardinality? What will be its
       cardinality if 4 rows are added in the table.                                                                                                  2
       (g) A table sales has following information:                                                                                                2
      TABLE :SALES

                                              SALE     COMMISSIO
                                              S        N
                                              6000           5
                                              0              6
                                                             0
                                              3500           4
                                              0              5
                                                             0
                                              2300           4
                                              0              0
                                                             0
                                               8000         NULL

              (i)    Select Avg (Commission) from Sales;
              (ii)    Select Count(Sales) from Sales;

              Q4. a. What is the difference between inheritance and polymorphism                          1

                   (b)Rewrite the following if-else segment using switch-case statement.                                           2
                     char ch = ‘P’;
                     if((ch == ‘p’) || (ch == ‘P’))
                            System.out.println("Platinum")
                            ;
                     if((ch == ‘g’) || (ch == ‘G’))
                            System.out.println("Gold")
                            ;
                     if(ch == ‘S’)
                            System.out.println("Silver")
                            ;
                    else                                                      ;
                           System.out.println("Normal")



        (c)What is the purpose of the following statement:
                jTextField1.setText(“Informatics Practices”,toUpperCase( ));                               1


        (d)  What will be the contents of sum after executing the following code:                                               1
                     int i = 2, j = 5,sum =0;
                      while (i < j)
                      {
                            sum+ =i;
                            i++;
                     }
   50   51   52   53   54   55   56   57   58   59   60