4,346 views
2 votes
2 votes

Q1)  R(A1,A2,A3,..................An)  having A1A2 as its candidate key. Find the no of super key..?

Q2)   R(A1,A2,A3,..................An)  having A1 and A2 as its candidate key. Find the no of super key..?

5 Answers

Best answer
6 votes
6 votes

(1) CK = A1A2

Every Super Key should include candidate key.Remaining attribute = n-2

Every attribute have 2 choices.

Hence,Number of Super key=2n-2

(2) Ck = A1 and A2

Number of super keys = Number of Keys because of A1 Number of Keys because of A2 -  Number of Keys because of A1 and A2

Number of super keys = 2n-1 + 2n-1- 2n-2

selected by
5 votes
5 votes

1) total superkeys ---> 2^(n-2)

2) n(A+B)= n(A) + n(B) - n(AB)

So total superkeys --> 2^(n-1) + 2^(n-1) - 2^(n-2) 

4 votes
4 votes

Q1. IN R A1A2 ARE THE CANDIDATE KEY.AND NON KEYS ARE(N-2)

SO NUMBER OF SUPERKEYS =2^(n-2)

Q2 .A1 =CANDIDATE KEY=(N-1) KEYS ARE NON KEYS THESE ARE=A2,A3,A4,A5....AN=>SUPERKEY=2^(N-1)

                                                                                                       SIMILARLY FOR A2=SUPERKEYS =2^(N-1)

NOW COMMON ELEMENT IN SET A1 AND A2 IS={A3,A4,A5,A6......AN}=(n-2)keys=THESE ARE THE KEYS WHICH COMBINED WITH BOTH {A1 AND A2} SO REMOVE THIS

==> NUM OF SUPERKEYS=2^(n-1)+2^(n-1)-2^(n-2)

IS THE ANS

YOU CAN PUT IN ANY NUM OF  SET TO VERIFIY

    

1 votes
1 votes

We know , number of super keys 2no of attribute- size of candidate key

1) Number of super keys =2n-2

2) Number of Super keys =2n-1

Related questions

0 votes
0 votes
1 answer
3
Deepalitrapti asked Aug 9, 2018
262 views
4 votes
4 votes
4 answers
4
Anirudh Pandey asked Sep 19, 2017
1,395 views
If A Relation R(A,B,C,D) and CK given is (AB,C)and FD is given as A->C Then the relation is in which highest normal form?