Given the following functional dependendies on a relation R(A B C D E F G)
AB → CF
BG → C
AEF → C
ABG → ED
CF → AE
A → CG
AD → FE
AC → B
I have worked out the candidate keys by using the method where you put the attribute in either a left, middle, right column depending if it is seen on the left hand side of a dependency, right hand side or both. Left means that the attribute is necessary, middle is unknown and right means not part of a key.
I got this:
L | M | R
--|---------|----
- | ABCDEFG | -
From here I worked out the closures for each individual attribute and the permutations: BC, BD, BE, BF, BG, CD, CF…
I found that only the closure of A and CF contain all attributes and therefore are candidate keys however the solution the problem also has BFG.
Can someone explain what I am doing wrong in calculating candidate keys?
Thanks
This algorithm tries to find shortcuts (pg 3), but in your case it doesn’t find any. To determine whether any particular combination of attributes is a key, you try to figure out whether that combination determines every other attribute. In your case, you’ve done all the work; you’re just missing something about BFG.
So BFG is a candidate key.