1 votes 1 votes R (A1, A2, ….An) and every (n-2) attributes of R forms a candidate key. How many super keys are there in R? a) $_{n-2}^{n}\textrm{C}$ b) $_{n-2}^{n}\textrm{C}$ * 4 c) $_{n-2}^{n}\textrm{C}$ * n d) $_{n-2}^{n}\textrm{C}$ + n +1 Databases superkeys databases candidate-key + – hacker16 asked Jan 17, 2018 hacker16 2.8k views answer comment Share Follow See all 18 Comments See all 18 18 Comments reply hs_yadav commented Jan 17, 2018 reply Follow Share options 1,2,3 can be easily eliminated....but last option is also not looking correct....? 0 votes 0 votes Hemant Parihar commented Jan 17, 2018 reply Follow Share Option D is correct. = $\binom{n}{n-2}$ + $\binom{n}{n-1}$ + $\binom{n}{n}$ = $\binom{n}{n-2}$ + n + 1. 4 votes 4 votes hs_yadav commented Jan 17, 2018 reply Follow Share hemant let consider..example...a1 a2 a3.... then .... CK(a1a2,a2a3,a1a3) SK(a1a2,a2a3,a1a3,a1a2a3)=4 but not following given formula...isn't it...:) .3C2=3+n+1=3+3+1=7 0 votes 0 votes Hemant Parihar commented Jan 17, 2018 reply Follow Share @hs_yadav, it is n-2 attribute, not n-1. 0 votes 0 votes Ashwin Kulkarni commented Jan 17, 2018 reply Follow Share Shouldn't it be $(^n_{n-2}) - (^n_{n-1}) + (^n_{n}) =\ ^nC_{n-2} -n +1 $ 0 votes 0 votes Ashwin Kulkarni commented Jan 17, 2018 reply Follow Share Like take {a1, a2, a3, a4} Then keys [a1a2] + {a2a3} + {a3a4} then $2^2 + 2^2 + 2^2 - 2^1 - 2^1 - 2^1 + 2^0 = 7$ 0 votes 0 votes hs_yadav commented Jan 17, 2018 reply Follow Share hemant still.same... see..3C3-2 + n+1=3+3+1=7 ? 0 votes 0 votes Hemant Parihar commented Jan 17, 2018 reply Follow Share @hs_yadav, For your example. R(a1, a2, a3) CK = {a1, a2, a3) SK = {a1, a2, a3, a1a2, a1a3, a2a3, a1a2a3} 0 votes 0 votes hs_yadav commented Jan 17, 2018 reply Follow Share @ Hemant Parihar ohh ..thanks.. 0 votes 0 votes hacker16 commented Jan 17, 2018 reply Follow Share option d) is correct. 0 votes 0 votes srivivek95 commented Jan 17, 2018 reply Follow Share @ Ashwin Kulkarni For n=4, you missed a few combinations for keys R(a1 a2 a3 a4) CK:{a1a2, a2a3, a3a4, a1a4, a1a3, a2a4} |SK|=11 i.e. option(d) 0 votes 0 votes Shubhanshu commented Jan 17, 2018 reply Follow Share @srivivek95 since every n-2 means 2 attribute is a CK, so considering a1a2 and a2a3 are the two CKs. So, <a1a2a3> and <a1a2a3> should be considered as two different SK as in them two different cominations of CK(in bolded letters) is present? 1 votes 1 votes joshi_nitish commented Jan 18, 2018 reply Follow Share there are n elements. every n-2 elements, every n-1 elements and all n elements will be super key. therefore total super keys possible are, $nC_{n-2}+nC_{n-1}+nC_n = nC_{n-2}+n +1$ 4 votes 4 votes Shubhanshu commented Jan 18, 2018 reply Follow Share @joshi_nitish may you answer my query? 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @Shubhanshu, you are misinterpreting a qsn, every n-2 does not mean 2 attributes is candidate key. let there are n=10 elements, n-2=8, every group of 8 attributes is candidate key. 1 votes 1 votes sumit goyal 1 commented Jan 18, 2018 reply Follow Share @ joshi_nitish why set theory concept is not applicable here , plz tell 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @sumit, you can use it if you want to. total subset are $2^n$, now all those subsets which are of size >=n-2 will be super keys 1 votes 1 votes sumit goyal 1 commented Jan 18, 2018 reply Follow Share @ joshi_nitish iam asking like : suppose a relation R1(A,B,C) , CK = { A,B,C} superkeys are = 4+4+4 - ( 2+2+2) +1 if here i try to apply then there will be n terms i stuck in it ? how you would apply plz explain 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes nCn-2+n+1 super keys. Anup dogrial answered Jan 17, 2020 Anup dogrial comment Share Follow See 1 comment See all 1 1 comment reply Madhulika kumari commented Oct 10, 2020 reply Follow Share Option d) works properly for n=4 then number of sk will be 11 But for n=3 no of superkeys should be 4 and according to option d) it shows 7 superkeys Someone please correct me if I m wrong?? 0 votes 0 votes Please log in or register to add a comment.