Third Normal Form (3NF) and Transitive Dependencies
Fast recall
Quick revision
Core answer
X → A, either X is a superkey or A is a prime attribute (part of a candidate key). In the common single-key case, this removes a chain such as employee_id → department_id → department_name, where one non-key attribute determines another.Ability to test functional dependencies using superkeys and prime attributes, then recognize the common transitive-dependency case
Using the non-key-to-non-key shortcut as the complete formal definition or checking only the primary key
Name the determinant, candidate keys, and dependent attribute before proposing a decomposition
Interview-ready guide
Interview answer
A relation is in Third Normal Form when each non-trivial dependency X → A has a superkey on the left or a prime attribute on the right.
A common violation is a transitive chain. In employees(employee_id, department_id, department_name), employee_id determines department_id, while department_id determines department_name. The department name is repeated for every employee in the same department and can become inconsistent if only some rows are updated.
The fix is a departments table keyed by department_id and an employees table that keeps department_id as a foreign key. This is different from 2NF: 2NF checks whether a non-prime attribute depends on only part of a candidate key, while 3NF checks all relevant functional dependencies.
The familiar rule that non-key attributes should not determine other non-key attributes explains this common case, but the superkey-or-prime test is the complete definition.
Third Normal Form (3NF) and Transitive Dependencies
Direct Answer
A relation is in Third Normal Form when, for every non-trivial functional dependency X → A, either X is a superkey or A is a prime attribute (part of a candidate key). In the common single-key case, this removes a chain such as employee_id → department_id → department_name, where one non-key attribute determines another.
Common Mistakes & Pitfalls
- Using only the shortcut: the formal test is that the determinant is a superkey or the dependent attribute is prime.
- Confusing 2NF and 3NF: 2NF removes dependency on part of a candidate key; 3NF checks every relevant dependency after 2NF.
- Inventing a dependency from correlation: confirm that one value really determines the other in the business model.
- Splitting every pair of columns: decomposition needs a real functional dependency and should preserve a lossless join.
Check your understanding
Answer these without looking back at the article.
- What is the difference between partial dependency in 2NF and transitive dependency in 3NF?
- What is BCNF and how does it differ from 3NF?
- Why is 3NF considered sufficient for most production databases?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.