in Databases retagged by
442 views
3 votes
3 votes
A relation $R(P,Q,R,S)$ has $\{PQ, QR, RS, PS\}$ as candidate keys. The total number of superkeys possible for relation $R$ is ______
in Databases retagged by
by
442 views

4 Comments

reshown by
@bikram sir, shouldnt the answer be 8 ??
0
0

@Bikram sir, shouldnt the answer be 8 ??

0
0
yes, answer should be 8.
0
0

with 4 elements i.e. {P,Q,R,S}, the number of combinations possible are 24 i.e. 16. Now from these 16 exclude o length and 1 length elements. thus 16-5 = 11. now with the length of 2 two combinations are not candidate keys i.e. PR and QS. So subtract these 2 also.

Hence 11-2 i.e. 9 are the candidate keys

1
1

2 Answers

9 votes
9 votes
Best answer
Number of Superkeys which are superset of PQ = 2^2 = 4

Number of Superkeys which are superset of QR = 2^2 = 4

Number of Superkeys which are superset of PS = 2^2 = 4

Number of Superkeys which are superset of RS = 2^2 = 4

Number of Superkeys which are superset of PQR = 2^1 = 2

Number of Superkeys which are superset of PQS = 2^1 =2

Number of Superkeys which are superset of PRS = 2^1 =2

Number of Superkeys which are superset of QRS = 2^1 = 2

Number of Superkeys which are superset of PQRS = 2^0 = 1

 

So, applying the formula of Set theory, the total number of Superkeys possible on given relation are = 4+4+4+4-2-2-2-2+1 = 9
selected by
2 votes
2 votes
PQRS QRPS RSPQ PSQR
PQR QRP RSP PSQ
PQS QRS RSQ PSR
PQ QR RS PS

No need to take others as they are repeated. You can take any one of them, just ensure that you have not taken them two times.

Answer:

Related questions