6,024 views
2 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
7 7 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 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 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 1 vote

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

0 0 votes

The no of super keys are :

1. A1A2 is a candidate key so the there are n-2 in (A1A2A3................An) ,therefore the super key is 2(n-2).

2.In this 2nd problem both A1 and A2 are seperate, so that 2(2(n-1))-2(n-2​).

Position:
Show:

Related questions

2 2 votes
1 1 answer
151
151 views
GO Classes asked Sep 8
151 views
Consider the relation schema $R(A,B,C,D,E)$ with$F=\{AB \to C,\ CD \to E,\ DE \to B\}$Which attributes must necessarily occur in every candidate key of $R$?$A$ $B$ $C$ $D...
2 2 votes
1 1 answer
145
145 views
GO Classes asked Sep 8
145 views
Consider the relation schema $R(A,B,C,D,E,F)$ with$F=\{BE \to C,\ B \to F,\ D \to F,\ AEF \to B,\ A \to E\}$Which of the following is a candidate key of $R$?$ACD$ $AD$ $F...
1 1 vote
1 1 answer
171
171 views
GO Classes asked Sep 2
171 views
Consider the following relation instance $R(A,B,C)$:$$\begin{array}{|c|c|c|}\hlineA & B & C \\\hline\alpha & \delta & \xi \\\beta & \delta & \psi \\\gamma & \eta & \xi \\...