Search code examples
databasefunctional-dependenciescandidate-key

Candidate keys after canonical cover


I have a set of functional dependencies:

V = {ABCDEF} F = {AB → CD,ABDE → F,BC → A,C → DF}

Candidate keys are: {ABE, BCE} Canonical cover is: {AB→ C, BC→ A, C→ DF} [This is what I think, might be wrong]

However, as you can see an attribute of candidate key, E, is not in my canonical cover and as far as I know candidate keys should be same in the canonical cover. If you consider Augmentation rule from Armstrong calculus we can say it is correct but I am confused. Does attribute E have to be represented in the canonical cover?


Solution

  • You say:

    as far as I know candidate keys should be same in the canonical cover

    This is not true. On the contrary, if an attribute does not belong to any right part of the functional dependencies of a canonical cover, it must be present in any candidate key (this is because it cannot be derived from any other subset of attributes, so, since a candidate key must determines all the attributes, it should be present in any key). Your canonical cover and candidate keys are correct.

    Note that if an attribute does not belong to any functional dependency (both in the left and right part), as E in your example, this is a special case of above (it does not belong the a right part side), and must be present in any candidate key.

    Finally, note that this can be considered a “symptom” of something wrong in the relation and in fact the schema is not in 3NF or BCNF.