Describes a relationship between attributes in a relation. Defines if one set of attributes can determine another.
If attribute set determines attribute set , it’s denoted as . Which means, for any two tuples in a relation, if their values are the same, their values must also be the same.
Here:
- X is called the determinant
- Y is called the dependent
A functional dependency represents a constraint on valid data. All candidate keys of a relation are determinants (they functionally determine every attribute).
Functional dependencies are basis of normalization. Helps find redundancy, anomalies.
Functional dependencies help identify candidate keys and are essential for designing robust relational schemas.
Trivial
Section titled “Trivial”A functional dependency is trivial if it is satisfied by all instances of a relation. Of the form where .
Legal instance
Section titled “Legal instance”For a relation: An instance of a relation that satisfies all real-world constraints.
If a relation is legal under set of functional dependencies , it’s mentioned as satisfies .
For a database: an instance of a database in which all the relations are legel.
If a set of functional dependencies is legal under a relation schema , it’s mentioned as holds on .
Armstrong’s axioms
Section titled “Armstrong’s axioms”- Reflexivity: If then
- Augmentation: If then
- Transitivity: If and and
The above rules are:
- sound - generate functional dependencies that hold
- complete - generate all functional dependencies that hold
Other inferred rules:
- union: If and then
- decomposition: If then and
- pseudotransitivity: If and then
Closure
Section titled “Closure”Suppose is a set of functional dependencies.
Closure of , denoted as , is the complete set of all functional dependencies that can be logically inferred from . Armstrong’s axioms are repeatedly applied to compute .
can be computed by:
Step-by-step procedure
Section titled “Step-by-step procedure”- Initialize = F
- For each functional dependency of , apply Armstrong’s axioms:
- Reflexivity
- Augmentation
- Transitivity
- Add each new functional dependency to .
- Continue applying rules until no new dependencies appear
Takes exponential time to compute.
Canonical Cover
Section titled “Canonical Cover”For a set of functional dependencies , its canonical cover is the minimal set of functional dependencies equivalent to , having no redundant dependencies or redundant parts of dependencies.