Anonymous user menu

The number of candidate keys possible ?

If there are 'n' attribute in table ,then number of candidate keys possible ?

meet @meet
8 Jan 2016 02:10 pm

according to me candidate key is always depends on FDS not on attributes. 

meet @meet
8 Jan 2016 02:22 pm

if u ask about maximum then N should be answer because....

let's consider the example : A → B, B → C, C → D, D → A
then candidate key is A,B,C,D.

so total 4 which is our total attributes.

jayendra @jayendra
11 Jan 2016 12:13 am

Answer is quite simple.. 

they have asked number of candidate keys "possible"... so we can assume that they are interested in maximum number of candidate keys..

Now definition of candidate key is: CK is a single field or least combination of fields that uniquely defines a row.

Super keys:

So possible number of combinations are same as possible number of binary strings.

n + nC2 + nC3 + .. + nCn  

candidate keys:

 For this we have to consider maximum number of combinations with same number of attributes.

for example.. if we have five attributes(A,B,C,D,E) then if we take individual attributes we can not take any other. But if we focus on AB, BC.. then we can consider all combinations with 2 attributes but not with 3 or 4. In this way we are getting maximum candidate keys.

If there are 6 attributes then we will get maximum CK at 6C3..

In general we can say, nCfloor(n/2) will give maximum combinations that we can consider as CK.. 

Arul @innovwelt
11 Jan 2016 12:19 am

just for the completeness, n + nC2 + nC3 + .. + nCn will be (2n - 1)

Parimal Andhalkar @parimal_andhalkar
10 Jan 2016 11:27 pm

but if we say A is candidate key then AB will not be a candidate key . AB will be super key .

then how we count AB also ?

meet @meet
10 Jan 2016 11:52 pm

yaa u r right @parimal

Arul @innovwelt
11 Jan 2016 12:07 am

This question looks ambiguous to me. I can understand this question in two ways:

  1. What are all the combinations of those 'n' attributes that can be candidate key to this table? (Jayendra's answer)
  2. What is the maximum possible number of candidate keys at a particular instant for this table? (meet's answer)


meet @meet
11 Jan 2016 12:11 am

ok bro......