Functional Dependency Theory

A Functional Dependency (FD) X → Y means:
If two tuples have the same X value, they must have the same Y value.


Armstrong's Axioms

  1. Reflexivity: If Y ⊆ X, then X → Y

  2. Augmentation: If X → Y, then XZ → YZ

  3. Transitivity: If X → Y and Y → Z, then X → Z


Closure of Functional Dependencies (F⁺)

All FDs that can be derived from a given set F.

Example:
F = {A → B, B → C}
F⁺ = {A → B, B → C, A → C, A → A, B → B, C → C, …}


Closure of Attribute Sets (X⁺)

All attributes functionally determined by set X.

Algorithm:

  1. Initialize X⁺ = X

  2. For each Y → Z in F: if Y ⊆ X⁺, add Z to X⁺

  3. Repeat until no changes

Example:
F = {A → B, B → C}
A⁺ = {A, B, C} (A determines B, B determines C)


Canonical Cover (Minimal Cover)

Simplified equivalent set of FDs with:

  1. Single attributes on the right side

  2. No extraneous attributes on the left

  3. No redundant FDs


Additional Dependency Types

1. Trivial Dependency

  • A dependency X → Y is trivial if Y ⊆ X.

  • Always true, adds no new information.

Example:

  • {A, B} → A is trivial (because A is part of {A, B}).

  • {RollNo, Name} → RollNo


2. Partial Dependency

  • A partial dependency occurs when a non-prime attribute (not part of any candidate key) is functionally dependent on part of a composite candidate key, not the whole key.

  • Problematic because it violates 2NF.

Example:
Relation: R(StudentID, CourseID, Grade, StudentName)

  • Candidate Key = {StudentID, CourseID}

  • FD: StudentID → StudentName
    👉 Here, StudentName depends only on part of the key (StudentID), not the whole {StudentID, CourseID}.
    So, partial dependency exists.


3. Transitive Dependency

  • A transitive dependency occurs when a non-prime attribute depends on another non-prime attribute via a candidate key.

  • Problematic because it violates 3NF.

Example:
Relation: R(StudentID, DeptID, DeptName)

  • Candidate Key = {StudentID}

  • FDs: StudentID → DeptID, DeptID → DeptName
    👉 StudentID → DeptName is implied, but DeptName depends transitively on StudentID through DeptID.
    So, transitive dependency exists.

A transitive dependency exists when:

  • X → Y (X is a candidate key or contains a candidate key),

  • Y → Z,

  • Y is not a candidate key, and

  • Z is a non-prime attribute.

So the problem occurs if a non-prime attribute (Z) is indirectly dependent on a key through another non-prime attribute (Y).

Updated on