-1

The relation R=(A,B,C,D,E) and functional dependencies F are given as follows:

F={A->BC, CD->E, B->D, E->A}

E, BC and CD can be a candidate keys, but B cannot.


Anyone could point me how this fact is calculated? I google it but couldn't understand more as what I known before.

Simon Bosley
  • 1,114
  • 3
  • 18
  • 41

1 Answers1

0

You can find all the dependent attributes of a given set of attributes by computing the closure of its functional dependencies. Let me demonstrate:

A -> ABC -> ABCD -> ABCDE

A determines BC (given) as well as itself (trivially) therefore A -> ABC. Add the fact that B -> D to get ABC -> ABCD. Finally, add CD -> E to get ABCD -> ABCDE. We stop here because we've determined the whole relation, therefore A is a candidate key.

You should verify that, starting from E, BC and CD, you can indeed determine the whole relation.

Starting from B, we get:

B -> BD

and that's it. The rest of the relation can't be determined from BD, so it's not a candidate key.

A more visual way of doing it is to sketch the functional dependencies:

Functional dependency graph

Starting from any set of attributes, try finding a path to every other attribute by following the arrows. You can only get to E if you start at E or visited both C and D.

From B, you can reach D, but without C, you're not allowed to go to E, which also excludes A. So B can't be a candidate key.

reaanb
  • 9,806
  • 2
  • 23
  • 37