Functional dependency
In relational database theory, a functional dependency (FD) is constraint between two attribute sets, whereby values in one set (the determinant set) determine the values of the other set (the dependent set). A functional dependency between a determinant set X and a dependent set Y can be described as follows:
Given a relation R and attribute sets X,Y R, then X is said to functionally determine Y (written X → Y) if each X value is associated with precisely one Y value. R is then said to satisfy the functional dependency X → Y. Equivalently, the projection is a function, that is, Y is a function of X.
In other words:
- when X attributes have known values (here, x), the values for their corresponding Y attributes can be determined by looking them up in any tuple of R containing x.
- two tuples sharing the same values of X will necessarily have the same values of Y.
A dependency FD: X → Y means that the values of Y are determined by the values of X. A functional dependency FD: X → Y is called trivial if Y is a subset of X.
The determination of functional dependencies is an important part of designing databases in the relational model, and in database normalization and denormalization. A simple application of functional dependencies is Heath's theorem; it says that a relation R over an attribute set U and satisfying a functional dependency X → Y can be safely split in two relations having the lossless-join decomposition property, namely into where Z = U − XY are the rest of the attributes. (Unions of attribute sets are customarily denoted by their juxtapositions in database theory.) An important notion in this context is a candidate key, defined as a minimal set of attributes that functionally determine all of the attributes in a relation. The functional dependencies, along with the attribute domains, are selected so as to generate constraints that would exclude as much data inappropriate to the user domain from the system as possible.
A notion of logical implication is defined for functional dependencies in the following way: a set of functional dependencies logically implies another set of dependencies , if any relation R satisfying all dependencies from also satisfies all dependencies from ; this is usually written . The notion of logical implication for functional dependencies admits a sound and complete finite axiomatization, known as Armstrong's axioms.