Course contentsShow
← Data Science
Lesson 1063 of 2,14527. Database Design and OptimizationFree lesson

Functional Dependencies

Understanding functional dependencies between attributes and how they determine normalization requirements.

Functional Dependencies

You'll learn how one attribute (or set of attributes) uniquely determines another — the foundation of database normalization.

What is a Functional Dependency?

A functional dependency exists when one attribute (or combination of attributes) uniquely determines the value of another attribute. We write this as A → B, meaning "A determines B" or "B is functionally dependent on A."

In plain English: if you know the value of A, you can always find exactly one corresponding value for B.

Real-World Analogy

Think of your social security number and your name. Your SSN → Your Name. If someone gives you a valid SSN, there's exactly one person (and thus one name) associated with it. The SSN determines the name.

Similarly, EmployeeID → EmployeeName. One employee ID always maps to one specific employee name.

Why This Matters for Normalization

Functional dependencies reveal hidden relationships in your data that can cause anomalies. When you documented insert, update, and delete anomalies earlier, functional dependencies were the underlying cause.

For example, in a table with (StudentID, CourseID, InstructorName), if CourseID → InstructorName (each course has one instructor), storing the instructor's name repeatedly for every student creates update anomalies. Functional dependencies tell you which attributes belong together in separate tables.

Types of Functional Dependencies

  • Trivial: StudentID → StudentID (always true, not useful)
  • Non-trivial: StudentID → StudentName (actually tells us something)
  • Partial: Part of a composite key determines an attribute
  • Transitive: A → B and B → C, so A → C

Key Takeaway: Functional dependencies describe deterministic relationships between attributes; identifying them correctly is essential for eliminating data anomalies and achieving proper normalization.