Database Reference
In-Depth Information
Composite Functional Dependencies
The determinant of a functional dependency can consist of more than one attribute. For ex-
ample, a grade in a class is determined by both the student and the class, or:
(StudentNumber, ClassNumber) S Grade
In this case, the determinant is called a composite determinant .
Notice that both the student and the class are needed to determine the grade. In general,
if (A, B) S C, then neither A nor B will determine C by itself. However, if A S (B, C), then it is
true that A S B and A S C. Work through examples of your own for both of these cases so that
you understand why this is true.
Finding Functional Dependencies
To fix the idea of functional dependency in your mind, consider what functional dependencies
exist in the SKU_DATA and ORDER_ITEM tables in Figure 3-1.
Functional Dependencies in the SKU_DATA Table
To find functional dependencies in a table, we must ask “Does any column determine the value
of another column?” For example, consider the values of the SKU_DATA table in Figure 3-1:
Consider the last two columns. If we know the value of Department, can we determine
a unique value of Buyer? No, we cannot, because a Department may have more than one
Buyer. In these sample data, 'Water Sports' is associated with Pete Hansen and Nancy Meyers.
Therefore, Department does not functionally determine Buyer.
What about the reverse? Does Buyer determine Department? In every row, for a given value
of Buyer, do we find the same value of Department? Every time Jerry Martin appears, for example,
is he paired with the same department? The answer is yes. Further, every time Cindy Lo appears,
she is paired with the same department. The same is true for the other buyers. Therefore, assum-
ing that these data are representative, Buyer does determine Department, and we can write:
Buyer S Department
Does Buyer determine any other column? If we know the value of Buyer, do we know the
value of SKU? No, we do not, because a given buyer has many SKUs assigned to him or her.
Does Buyer determine SKU_Description? No, because a given value of Buyer occurs with many
values of SKU_Description.
By The WAy As stated, for the Buyer S Department functional dependency, a Buyer is
paired with one and only one value of Department. Notice that a buyer can
appear more than once in the table, but, if so, that buyer is always paired with the same
department. This is true for all functional dependencies. If A S B, then each value of
A will be paired with one and only one value of B. A particular value of A may appear
more than once in the relation, but, if so, it is always paired with the same value of B.
Note, too, that the reverse is not necessarily true. If A S B, then a value of B may be
paired with many values of A.
 
Search WWH ::




Custom Search