Skip to content
Contents/CH 20
Normalization/Advanced · 14 min

Normalization: 3NF

Third normal form removes the chain: a non-key attribute should not determine another non-key attribute.

In plain English

If A tells you B, and B tells you C, do not store C next to A.

The one idea

Third normal form removes transitive dependencies: every non-key attribute depends on a candidate key and nothing else.

If A determines B and B determines C, storing C next to A repeats C for every A. The repetition is the anomaly.

By the end

  1. 01Define a transitive dependency.
  2. 02Test a relation for 3NF.
  3. 03Decompose a relation into 3NF.
  4. 04Explain the trade-offs of further normalization.
01

The rule

A relation is in 3NF if it is in 2NF and no non-key attribute transitively determines another non-key attribute. Equivalently, every functional dependency X → A has X as a superkey or A as a prime attribute. The second wording is the formal test.

02

A transitive dependency example

Student(student_id, student_name, advisor_id, advisor_name) has student_id → advisor_id and advisor_id → advisor_name. Therefore student_id → advisor_name transitively. advisor_name is a non-key attribute determined by another non-key attribute, so the relation is not in 3NF.

chapter-20.db
student_id -> advisor_id
advisor_id -> advisor_name
student_id -> advisor_name   transitive
03

Decomposition

Split the transitive dependency into its own relation: Student(student_id, student_name, advisor_id) and Advisor(advisor_id, advisor_name). The foreign key advisor_id preserves the relationship. The decomposition is lossless because the common attribute is a key in one of the relations.

chapter-20.db
Student(student_id, student_name, advisor_id)
Advisor(advisor_id, advisor_name)
04

Trade-offs

3NF reduces redundancy and update anomalies, but it can increase the number of joins. Sometimes a controlled denormalization is justified for read-heavy workloads. Make that choice deliberately, with measurements, not by accident.

Worked example3 steps

Student, advisor, and advisor name

Student(student_id, student_name, advisor_id, advisor_name) has key student_id.

01

Identify the dependencies.

student_id → advisor_id and advisor_id → advisor_name.

02

Compose them.

student_id → advisor_name is transitive, so advisor_name is not directly dependent on the key.

03

Move advisor_name to Advisor(advisor_id, advisor_name).

Student keeps advisor_id as a foreign key; the advisor name appears once.

Conclusion3NF does not forbid foreign keys. It forbids a non-key attribute from depending on another non-key attribute.

Instrument

Watch it happen.

Step through one operation at a time

Step player01 / 03
01

Start with the 3NF target table

The table violates 3NF: no transitive dependency.

Student (2NF, not 3NF)
student_idstudent_nameadvisor_idadvisor_name
1AdaA1Dr. Hopper
2GraceA1Dr. Hopper
3LinusA2Dr. Turing

The trade-off

No free correctness.

Gain

Updates touch one advisor row, not every student.

Cost

Reading a student with an advisor name requires a join.

Verdict

Target 3NF for transactional schemas; use BCNF when overlapping candidate keys cause remaining anomalies.

Recap

What to keep.

Takeaways

  • +3NF removes transitive dependencies among non-key attributes.
  • +The formal test: every determinant is a superkey or the dependent is prime.
  • +Decompose the transitive dependency into its own relation.
  • +Lossless decomposition requires a common key.
  • +Denormalize only with a measured reason.

Traps

  • !Confusing 3NF with 2NF.
  • !Decomposing without preserving the relationship.
  • !Denormalizing before measuring the read workload.

Focus

  • →Identify a transitive dependency.
  • →Apply the formal 3NF test.
  • →Decompose and verify a lossless join.

Check yourself

Before you turn the page.

0 / 2 answered
01

What does 3NF remove?

02

Which decomposition is lossless?

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