Page 49 - IP
P. 49

Ans:  Create table Books
                         (
                         BOOK_ID Integer (2) Primary Key,
                         BOOK_NAME Varchar (20),
                         CATEGORY Varchar (20),
                         ISSUE_DATE Date
                         );

                         (2 mark for correct query)

                                                                             OR
                         Column Name                  Data Type
                         RollNo                               Integer
                         Name                                 Varchar(20)

                         (1 mark for each correct column name along with suitable data type)

                  (b)      In a Bank’s database, there are two tables ‘Customer’ and ‘Transaction’ as
                         shown below.
                                                          Customer

                          Acc_No      Cust_Name      Cust_City     Cust_Phone      Open_Bal

                          2101001     Sunita         Ambala        9710557614      10000

                          2201002     Sandhya        Patna         8223545233      15000


                          2301003     Vivek          New Delhi     9972136576      13000


                          2401004     Meena          New Delhi     9321305453      10000


                                                      Transaction

                          Trans_Id       Acc_No         Transaction_Type     Amount

                          Tr001          2301003        Credit               15000
                          Tr002          2201002        Credit               20000
                          Tr003          2101001        Debit                3500
                          Tr004          2301003        Credit               26000
                          Tr005          2301003        Credit               24000

                         Consider these tables while attempting the questions given below:

                  (i)       Identify the candidate keys of Customer table.                               1
                                                                         OR
                         Briefly explain the concept of Candidate keys.

                  Ans:   Acc_No, Cust_Phone

                         (½  mark for each correct answer)


                                                           12
   44   45   46   47   48   49   50   51   52   53   54