Skip to content
Sahithyan's S3
1
Sahithyan's S3 — Database Systems

Functional Dependencies

Describes a relationship between attributes in a relation. Defines if one set of attributes can determine another.

If attribute set XX determines attribute set YY, it’s denoted as XYX → Y. Which means, for any two tuples in a relation, if their XX values are the same, their YY 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.

A functional dependency is trivial if it is satisfied by all instances of a relation. Of the form ABA \rightarrow B where BAB \subseteq A.

For a relation: An instance of a relation that satisfies all real-world constraints.

If a relation rr is legal under set of functional dependencies FF, it’s mentioned as rr satisfies FF.

For a database: an instance of a database in which all the relations are legel.

If a set of functional dependencies FF is legal under a relation schema RR, it’s mentioned as FF holds on RR.

  • Reflexivity: If βα\beta \subseteq \alpha then αβ\alpha \rightarrow \beta
  • Augmentation: If αβ\alpha \rightarrow \beta then γαγβ\gamma\alpha \rightarrow \gamma\beta
  • Transitivity: If αβ\alpha \rightarrow \beta and βγ\beta \rightarrow \gamma and αγ\alpha \rightarrow \gamma

The above rules are:

  • sound - generate functional dependencies that hold
  • complete - generate all functional dependencies that hold

Other inferred rules:

  • union: If αβ\alpha \rightarrow \beta and αγ\alpha \rightarrow \gamma then αβγ\alpha \rightarrow \beta\gamma
  • decomposition: If αβγ\alpha \rightarrow \beta\gamma then αγ\alpha \rightarrow \gamma and αβ\alpha \rightarrow \beta
  • pseudotransitivity: If αβ\alpha \rightarrow \beta and γβδ\gamma\beta \rightarrow \delta then αγδ\alpha\gamma \rightarrow \delta

Suppose FF is a set of functional dependencies.

Closure of FF, denoted as F+F^+, is the complete set of all functional dependencies that can be logically inferred from FF. Armstrong’s axioms are repeatedly applied to compute F+F^+.

F+F^+ can be computed by:

  1. Initialize F+F^+ = F
  2. For each functional dependency of F+F^+, apply Armstrong’s axioms:
  • Reflexivity
  • Augmentation
  • Transitivity
  1. Add each new functional dependency to F+F^+.
  2. Continue applying rules until no new dependencies appear

Takes exponential time to compute.

For a set of functional dependencies FF, its canonical cover is the minimal set of functional dependencies equivalent to FF, having no redundant dependencies or redundant parts of dependencies.