Search code examples
relational-databaserdbmsfunctional-dependenciescandidate-key

How can I determine the candidate keys in this relation


I have the relation R(ABCDEF) and the functional dependencies F{AC->B, BD->F, F->CE}

I have to find all the candidate keys for the relation(Armstrong axioms).

I did this:

A->A, B->B, C->C, D->D, E->E, F->F

From F->CE => F->C and F->E

And then:
 1. BD->F
 2. F->E
 3. BD->E
 4. BD->EF
 5. BD->BD
 6. BD->BDEF
 7. BD->F
 8. F->CEF
 9. BD->CEF     => BD->BCDEF

Now I am trying to get A on the right hand side of BD->BCDEF so BD can become a candidate key.

It would be great if someone could help.

EDIT:

 1. ABD->ABCDEF
 2. ACD->BD
 3. ACD->ABD    => AC->B and ACD->ABCDEF => BD->ABCDEF

Solution

  • The last step in your (edited) logic is

    AC->B and ACD->ABCDEF, therefore BD->ABCDEF
    

    It looks like you've replaced AC with B on the left-hand side. You seem to be thinking in arithmetical terms, not in terms of Armstrong's rules of inference. There isn't a rule of inference that says "if AC->B, then wherever AC appears, you can replace AC with B". (Sometimes it looks like that's what happens, but it's not.) AC and B aren't equal, and they're not equivalent.

    Imagine that people's names are unique. Then "name" would determine "height", and "name" would determine "weight". But you can't replace name with height; you can't say that "height" determines "weight". The terms aren't equal, and they're not equivalent.

    BD is not a candidate key, but ABD is. (There are others.)