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..? Databases + – dhairya 6.0k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
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 LeenSharma answered Jun 18, 2016 • selected Mar 13, 2017 by Kapil LeenSharma comment Share Follow 0 reply Please log in or register to add a comment.
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) Kapil answered Jun 18, 2016 Kapil comment Share Follow 0 reply Please log in or register to add a comment.
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 asu answered Jun 18, 2016 asu comment Share Follow See all 6 Comments 6 6 Comments reply Show 3 previous comments Sanjay Sharma commented Jun 18, 2016 reply Follow flag minimal means possible minimum if A1 alone is not c.key then A1A2 combination will give c.key which is minimal 0 0 replyShare dhairya commented Jun 18, 2016 reply Follow flag ohhh... ok... f9..thankk u.. 0 0 replyShare asu commented Jun 18, 2016 reply Follow flag yes what sanjay told is correct @dhaairya 0 0 replyShare Please log in or register to add a comment.
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 srestha answered Jun 18, 2016 srestha comment Share Follow See all 4 Comments 4 4 Comments reply LeenSharma commented Jun 18, 2016 reply Follow flag For (2) your answer is not right.There are Two candidate keys is given A1 and A2. For only one Key your answer is right. 0 0 replyShare Sanjay Sharma commented Jun 18, 2016 reply Follow flag case 2) in case n=3 ans should be 6 (A1,A2,A1A2,A1A3,A1A2A3,A2A3) but 2^3-1=4 0 0 replyShare vijaycs commented Jun 18, 2016 reply Follow flag is A1A2 a super key ?? 0 0 replyShare LeenSharma commented Jun 18, 2016 reply Follow flag yes,A1A2 is a super Key. 0 0 replyShare Please log in or register to add a comment.
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). Vishal_Shinde answered Jun 18, 2016 Vishal_Shinde comment Share Follow 0 reply Please log in or register to add a comment.