Candidate-key
Question 1 |
Consider a relational table with a single record for each registered student with the following attributes.
- 1. Registration_Num: Unique registration number
of each registered student
2. UID: Unique identity number, unique at the national level for each citizen
3. BankAccount_Num: Unique account number at the bank. A student can have multiple accounts or join accounts. This attribute stores the primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel
Which one of the following option is INCORRECT?
BankAccount_Num is a candidate key | |
Registration_Num can be a primary key | |
UID is a candidate key if all students are from the same country | |
If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey |
Question 1 Explanation:
In case two students hold joint account then Bank Account_Num will not uniquely determine other attributes.
Question 2 |
The maximum number of superkeys for the relation schema R(E, F, G, H) with E as the key is _____.
8 | |
9 | |
10 | |
11 |
Question 2 Explanation:
Maximum no. of possible super keys for a relation with n attributes with one candidate key (only one attribute) = 2n-1
Here, n = 4.
So, the possible super keys = 24-1 = 8
The super keys are: E, EH, EG, EF, EGH, EFH, EFG, EFGH.
Here, n = 4.
So, the possible super keys = 24-1 = 8
The super keys are: E, EH, EG, EF, EGH, EFH, EFG, EFGH.
There are 2 questions to complete.
