Page 107 - C++
P. 107

}

          (c) Write a function in C++ to display object from the binary file “PRODUCT.Dat” whose product price is more
          than Rs 200. Assuming that binary file is containing the objects of the following class:             [3]


          class PRODUCT

          {

          int PRODUCT_no;
          char PRODUCT_name[20];
           float PRODUCT_price;
          public:
          void enter( )

          {

          cin>> PRODUCT_no ; gets(PRODUCT_name) ; cin >> PRODUCT_price;

          }

          void display()

          {

          cout<< PRODUCT_no ; cout<<PRODUCT_name ;cout<< PRODUCT_price;

          }

          int ret_Price( )

          {

          return PRODUCT_price;

          }

          };

          5 (a) What do you understand by the terms Alternate key and Foreign Key of a relation?               [2]
          Consider the following tables SCHOOL and ADMIN. Write SQL commands for the statements (i) to (iv) and give outputs
          for SQL queries (v) to (viii).                                                                       [6]


                                                     SCHOOL
                                                                                      PERIOD
                          CODE   TEACHERNAME           SUBJECT             DOJ           S        EXPERIENCE

                                                                        12/03/20
                          1001    RAVI SHANKAR         ENGLISH             00           24               10

                                                                        03/09/19
                          1009    PRIYA RAI            PHYSICS             98           26               12

                                                                        09/04/20
                          1203    LISA ANAND           ENGLISH             00           27                5

                                                                        24/08/20
                          1045    YASHRAJ              MATHS               00           24               15

                                                                        16/07/19
                          1123    GANAN                PHYSICS             99           28                3

                                                                        19/10/19
   102   103   104   105   106   107   108   109   110   111   112