codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🗄️

DBMS

23 chapters

1Intro & 3-Schema Architecture2ER Model & Diagrams3Generalization, Specialization & Aggregation4Relational Model & Codd's Rules5Relational Algebra6Tuple & Domain Relational Calculus7SQL: DDL, DML, DCL8Advanced SQL (Joins, Aggregates)9Views, Triggers & Stored Procedures10Functional Dependencies11Normalization (1NF, 2NF, 3NF)12BCNF & Lossless Decomposition13Transaction Concepts & ACID14Conflict & View Serializability15Concurrency Control & Locks162-Phase Locking (2PL)17Timestamp-Based Protocols18Indexing (Primary, Clustering)19B-Trees & B+ Trees20Hashing Techniques in DBMS21Database Recovery Techniques22NoSQL Databases Overview23Data Warehousing Concepts
SubjectsDBMS

Functional Dependencies

Updated 2026-04-30
3 min read

Functional Dependencies

Before we can eliminate data redundancy by normalizing our database, we must understand the mathematical relationships between the columns in our tables. This is defined by Functional Dependencies (FDs).

1. What is a Functional Dependency?

A Functional Dependency is a constraint that specifies the relationship between two sets of attributes in a relation from a database.

If $R$ is a relation schema and $\alpha$ and $\beta$ are sets of attributes, then the functional dependency $\alpha \rightarrow \beta$ (read as "$\alpha$ functionally determines $\beta$") holds on $R$ if, for any two tuples (rows) in the table:

  • If they have the exact same value for $\alpha$, they MUST have the exact same value for $\beta$.

Real-World Example

Consider a Student table with columns: StudentID, Name, DateOfBirth.

  • StudentID -> Name: This is a valid functional dependency. If two rows have the exact same StudentID, they must belong to the exact same person, so the Name must be identical.
  • Name -> DateOfBirth: This is NOT a valid functional dependency. Two different students can have the exact same name ("John Smith"), but they might be born on completely different dates.

2. Trivial vs. Non-Trivial FDs

  • Trivial FD: An FD $\alpha \rightarrow \beta$ is trivial if $\beta$ is a subset of $\alpha$.
    • Example: {StudentID, Name} -> Name. This is mathematically obvious and doesn't give us any useful constraints.
  • Non-Trivial FD: An FD $\alpha \rightarrow \beta$ is non-trivial if $\beta$ is not a subset of $\alpha$.
    • Example: StudentID -> Name.

3. Armstrong's Axioms

To systematically discover all functional dependencies in a database, we use Armstrong's Axioms. These are a set of sound and complete inference rules.

Let $X$, $Y$, and $Z$ be sets of attributes.

  1. Reflexivity Rule: If $Y \subseteq X$, then $X \rightarrow Y$.
  2. Augmentation Rule: If $X \rightarrow Y$, then $XZ \rightarrow YZ$.
  3. Transitivity Rule: If $X \rightarrow Y$ and $Y \rightarrow Z$, then $X \rightarrow Z$.

Derived Rules

From the three axioms above, we can prove several other extremely useful rules:

  • Union Rule: If $X \rightarrow Y$ and $X \rightarrow Z$, then $X \rightarrow YZ$.
  • Decomposition Rule: If $X \rightarrow YZ$, then $X \rightarrow Y$ and $X \rightarrow Z$.
  • Pseudotransitivity Rule: If $X \rightarrow Y$ and $WY \rightarrow Z$, then $WX \rightarrow Z$.

4. Attribute Closure

The Closure of a set of attributes $X$ with respect to a set of functional dependencies $F$, denoted as $X^+$, is the set of all attributes that are functionally determined by $X$.

Why is this important? If the closure of $X$ ($X^+$) contains absolutely every attribute in the entire table, then $X$ is a Super Key for that table! If $X$ is minimal, it is a Candidate Key.

Finding attribute closures is the mathematical foundation for proving what the Primary Key of a table should be.



PreviousViews, Triggers & Stored ProceduresNextNormalization (1NF, 2NF, 3NF)

Recommended Gear

Views, Triggers & Stored ProceduresNormalization (1NF, 2NF, 3NF)