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

Functional Dependencies

A relationship between two sets of attributes in a relational database. Denoted as X → Y. A generalization of a key. Means that for any two rows in a table, if the values of attributes in set X are the same, then the values of attributes in set Y must also be the same. In other words, the value of X uniquely determines the value of Y.

Functional dependencies are fundamental to understanding how data is organized and how redundancy can be minimized. They are used to guide the process of normalization, which helps ensure that the database structure is efficient and free from undesirable anomalies.

Consider a table with attributes StudentID, StudentName, and Major. If each StudentID is unique and always refers to the same StudentName, then there is a functional dependency:
StudentID → StudentName

Functional dependencies help identify candidate keys and are essential for designing robust relational schemas.

Trivial

A functional dependency is trivial if it is satisfied by all instances of a relation. Of the form ABA → 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.

Closure

Suppose a set of functional dependencies FF. The set of all functional dependencies logically implied by FF. Superset of FF. Denoted by F+F^+.

Armstrong’s axioms

Closure of FF can be found by repeatedly applying Armstrong’s axioms.

  • 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

Superkey

KK is a superkey for a relation schema RR iff K    RK \implies R.

Candidate key

KK is a candidate for a relation schema RR iff K    RK \implies R and KK is minimal.