Course contentsShow
← Computer Science
Lesson 1638 of 2,87237. Database Design and NormalizationFree lesson

Transitive Dependencies Explained

Identifying when non-key attributes depend on other non-key attributes rather than directly on the primary key.

Transitive Dependencies Explained

What you'll learn: How to spot when one non-key attribute determines another, creating an indirect relationship with the primary key.

The Core Idea

A transitive dependency occurs when a non-key attribute depends on the primary key indirectly through another non-key attribute. In other words: if A determines B, and B determines C, then C depends on A transitively (through B).

This matters because transitive dependencies violate Third Normal Form (3NF) and can cause data anomalies.

Understanding the Pattern

The structure looks like this:

  • Primary Key → Non-Key Attribute₁ → Non-Key Attribute₂

The second non-key attribute doesn't depend directly on the primary key—it depends on another non-key attribute that itself depends on the primary key.

Real-World Example

Imagine a table: Employee(EmployeeID, DepartmentID, DepartmentName)

  • EmployeeID → DepartmentID (each employee belongs to one department)
  • DepartmentID → DepartmentName (each department has one name)
  • Therefore: EmployeeID → DepartmentName transitively

Here, DepartmentName depends on EmployeeID only because it first depends on DepartmentID. This is a transitive dependency.

Why It Matters

Transitive dependencies create problems:

  • Update anomalies: Changing a department name requires updating every employee in that department
  • Insertion anomalies: You can't store a department name without an employee
  • Deletion anomalies: Deleting the last employee removes department information

Analogy

Think of a chain: you're connected to your city through your street address. If someone asks your city, they get it through your address, not directly from knowing you.

Key Takeaway: A transitive dependency exists when a non-key attribute depends on the primary key indirectly through another non-key attribute, creating the pattern PK → Non-Key₁ → Non-Key₂ and violating Third Normal Form.