Page 61 - C++
P. 61

In.seekg(70*sizeof(P));
                                    In.read((char*)&P, sizeof(P));
                                    In.read((char*)&P, sizeof(P));
                                    cout<<"At Product:"<<In.tellg()/sizeof(P) + 1;
                                    In.close();
                             }

                                                                        OR

                      (c)    Which file stream is required for seekg() ?

             5        (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)    Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to     (4+2)
                             (viii), which are based on the tables.
                                                          TRAINER
                              TID  TNAME                CITY                HIREDATE  SALARY
                              101    SUNAINA            MUMBAI              1998-10-15    90000
                              102    ANAMIKA            DELHI               1994-12-24    80000
                              103    DEEPTI             CHANDIGARG          2001-12-21    82000
                              104    MEENAKSHI          DELHI               2002-12-25    78000
                              105    RICHA              MUMBAI              1996-01-12    95000
                              106    MANIPRABHA  CHENNAI                    2001-12-12    69000

                                                             COURSE
                              CID        CNAME          FEES        STARTDATE         TID
                              C201       AGDCA          12000       2018-07-02        101
                              C202       ADCA           15000       2018-07-15        103
                              C203       DCA            10000       2018-10-01        102
                              C204       DDTP           9000        2018-09-15        104
                              C205       DHN            20000       2018-08-01        101
                              C206       O LEVEL        18000       2018-07-25        105


                                                              9
   56   57   58   59   60   61   62   63   64   65   66