| Lesson 4 | Transitive dependencies in more Detail |
| Objective | Explain How to eliminate Transitive Dependencies |
A transitive dependency exists when a non-key attribute depends on another non-key attribute, creating an indirect path from the key to that attribute. Even if your table is in Second Normal Form (2NF)—that is, it has no partial dependencies—transitive dependencies can still introduce redundancy and update anomalies. This lesson shows how to identify and remove them to reach Third Normal Form (3NF).
Use the “chain” test: if A → B and B → C with B and C non-prime, then you have a transitive dependency A → C. This typically manifests as repeated descriptive data that belongs to a different subject area.
Assume each item belongs to exactly one category:
Item (ItemNo, Title, Price, CategoryID, CategoryName, CategoryManager)
Key dependencies:
ItemNo → Title, Price, CategoryID
CategoryID → CategoryName, CategoryManager
Because ItemNo determines CategoryID and CategoryID determines CategoryName and CategoryManager, the category facts are stored redundantly across many items. Result: inconsistent edits (update anomaly), inability to add a category before its first item (insert anomaly), and risk of losing a category when its last item is deleted (delete anomaly).
Move each distinct business concept into its own relation where its facts are determined by its key—nothing else. For the example:
Item(ItemNo, Title, Price, CategoryID)
Category(CategoryID, CategoryName, CategoryManager)
Link them with a foreign key (Item.CategoryID → Category.CategoryID). Now category facts live in one place, and the item table contains only item-specific attributes.
X, check if it depends on the key only through another non-prime attribute.ID (e.g., CategoryID) to make relationships obvious.CategoryName) unique and indexed even when using surrogate keys, to prevent silent duplicates.FOREIGN KEY constraints; consider ON UPDATE/DELETE actions that match your business rules.For a compact summary of the requirements of First, Second, and Third Normal Forms, see the landing page:
First, Second, and Third Normal Forms
With transitive dependencies removed, your schema reaches 3NF: every non-prime attribute depends on the key, the whole key, and nothing but the key,no indirect paths.