Skip to content
Contents/CH 16
Normalization/Advanced · 16 min

Functional Dependencies

A functional dependency is a rule about the data: if you know X, you can determine Y. Normalization is the process of organizing tables so those rules do not create redundancy.

In plain English

If you know a student's ID, you know their name. That is a functional dependency.

The one idea

X → Y means every two tuples that agree on X must also agree on Y; the dependency is a rule, not a correlation you noticed once.

Functional dependencies are the evidence behind normalization. Without them, decomposition is just moving columns around.

By the end

  1. 01Read X → Y as a functional dependency.
  2. 02Apply Armstrong's axioms to derive dependencies.
  3. 03Compute an attribute closure.
  4. 04Identify partial and transitive dependencies.
01

The notation

X → Y means every pair of tuples that agree on X must also agree on Y. If student_id → student_name, two rows with the same student_id must have the same student_name. The dependency is a property of the domain, not of the current rows.

chapter-16.db
student_id -> student_name
course_id  -> course_name
(student_id, course_id) -> grade
02

Armstrong's axioms

Reflexivity: if Y is a subset of X, then X → Y. Augmentation: if X → Y, then XZ → YZ. Transitivity: if X → Y and Y → Z, then X → Z. These three rules generate all dependencies implied by a set. Union and decomposition are derived rules.

chapter-16.db
reflexivity:   if Y ⊆ X, then X -> Y
augmentation:  if X -> Y, then XZ -> YZ
transitivity:  if X -> Y and Y -> Z, then X -> Z
03

Closure and candidate keys

The closure of X, written X+, is the set of all attributes determined by X. If X+ contains every attribute, X is a superkey. If no proper subset of X has that property, X is a candidate key. Computing closures is a systematic way to find keys from dependencies.

chapter-16.db
R(A, B, C, D)
A -> B
B -> C

A+ = {A, B, C}
A is not a key unless D is also determined.
04

Partial and transitive dependencies

A partial dependency is a non-key attribute that depends on only part of a composite key. A transitive dependency is a non-key attribute that depends on another non-key attribute. Both are the targets of 2NF and 3NF respectively.

Worked example3 steps

Advisor depends on student

A Student table contains student_id, student_name, advisor_id, and advisor_name.

01

Observe student_id → student_name and student_id → advisor_id.

The student id determines the student's own facts and their assigned advisor.

02

Observe advisor_id → advisor_name.

The advisor id determines the advisor name.

03

Compose the dependencies.

student_id → advisor_name is transitive, which is exactly the 3NF violation.

ConclusionA dependency found in one sample is not a guarantee. It becomes a schema rule only when the business confirms it or a constraint enforces it.

The trade-off

No free correctness.

Gain

A precise basis for keys, decomposition, and anomaly analysis.

Cost

Real domains have conditional dependencies and exceptions that are hard to enumerate.

Verdict

Write the dependencies down before normalizing; test them against future data, not just today's rows.

Recap

What to keep.

Takeaways

  • +X → Y means X determines Y.
  • +Armstrong's axioms derive all implied dependencies.
  • +X+ is the set of attributes determined by X.
  • +A candidate key determines every attribute and is minimal.
  • +Partial and transitive dependencies cause redundancy.

Traps

  • !Reading dependencies from a single sample table rather than the domain.
  • !Forgetting that a candidate key must be minimal.
  • !Confusing a superkey with a candidate key.

Focus

  • →Compute a closure from a small dependency set.
  • →Find a candidate key.
  • →Identify a partial and a transitive dependency.

Check yourself

Before you turn the page.

0 / 2 answered
01

What does X → Y mean?

02

Which axiom says if X → Y, then XZ → YZ?

DB//COSMOS

A field manual for database systems: model the domain, normalize the facts, query the relations, and protect the result.

Edition 2026 · 32 chaptersTopic catalogInterview prep