# Keys of a relation

I got relation:

R = { (ABCDEF) , (A B F -> C, B C -> F, F -> A, F -> B, D E -> E, E -> D)}

keys of this relation are:

{BCE}, {EF}

But I don't get it... why? Why not only {EF}.. it got less attributes than {BCE}..

Another example, relation:

R2 = {(ABCDEF), (A -> B C , B -> D , E -> F)}

and the key is:

{AE}

why only one? Why not:

{AE}, {ABE}

ABE also determines all other attributes, why is it not a key?

• In the 2nd question, `ABCDEF` also determines all attributes. Why not that too? – ypercubeᵀᴹ Jan 19 '14 at 17:57
• Yea, I know it determines all atributes. And I ask myself the same question. Why not? Thats what i am asking. Maybe its the dumbest question I have ever asked.. but there it is. – Ariel Grabijas Jan 19 '14 at 18:04
• Revisit your notes about the definition of a key. See also the Wikipedia page on Superkey where what you call a key (if I understand you correctly) is referred to as a "candidate key" or "minimal superkey". The key word (sorry for the pun) is minimal. – ypercubeᵀᴹ Jan 19 '14 at 18:15
• I understand why EF is a key (first example) - its obvious. There are no keys among 1-attribute expressions, and EF is a key among 2-attribute expressions. But why BCE is also a key? How can it be minimal if it has 3 attributes, and EF got 2... 2 < 3. Therefore BCE is not minimal. – Ariel Grabijas Jan 19 '14 at 18:39
• Minimal does not mean smallest in size (number of attributes). But smallest when compared as sets. Means it has no subset which is also a superkey. No subset of `EF` and no subset of `BCE` is a superkey, so these two are the minimal superkeys. – ypercubeᵀᴹ Jan 19 '14 at 19:08