Fordham, New York City's Jesuit University
back Back to course home page

FORDHAM UNIVERSITY, Fordham College Lincoln Center
CSEU 3500 -- Data Base Systems
Dept. of Computer & Info. Sciences, Spring, 2004

Functional Dependency Diagrams

Drawing the diagrams: Functional dependency diagrams are a useful diagrammatic way of showing functional dependencies. They are especially helpful in deducing the closure of an attribute set or of a set of functional dependencies. These diagrams are not used by Silberschatz, Korth, and Sudarshan. They can be found in Date's book, but he does not give a formal definition of the rules for drawing these diagrams. The following are some guidelines for drawing functional dependency diagrams.

  1. Each attribute in the relation schema appears only once in the diagram.
  2. If the left side of a functional dependency consists of an irreducible set of attributes, these attributes are enclosed in a box from which the arrow for that FD originates.
  3. All arrows terminate on single attributes. In other words, apply Armstrong's decomposition rule to turn FDs with multiple attributes on the right-hand side into multiple FDs with only one attribute on the right-hand side.

Example: Given the set of functional dependencies

$ A \rightarrow BC $
$ CG \rightarrow HI $
$ B \rightarrow H$

The FD diagram for this set of FDs would be:

\put( 10,70){\framebox (20,20){$A$}}
\put( 30,80){\vect...
...0,40){\framebox (20,20){$H$}}
\put(120,10){\framebox (20,20){$I$}}

Coloring Algorithm: An algorithm for using a FD diagram to compute the closure of an attribute set is as follows:

$\textstyle \parbox{0.85\textwidth}{
Color each attribute in the given set. \\
...x. \\
Color any attributes pointed to
by an arrow from a colored box.} \\

When finished, the closure of the attribute set is colored. For example, applying this procedure to the attribute set $AG$ with the above functional dependency set, $A$ and $G$ are colored, then the first round colors $B$ and $C$ via $A$. Then since both $C$ and $G$ are colored, the box containing them is colored. Then $H$ is colored via either $B$ or $CG$, and $I$ is colored via $CG$. At this point everything is colored, showing that $AG^+$ is the whole schema and hence $AG$ is a candidate key.

Robert Moniot 2004-04-07