0% completed
Inference rules, also known as Armstrong’s Axioms, are foundational rules used to derive all possible functional dependencies from a given set of dependencies in a relational database. These rules—Reflexivity, Augmentation, and Transitivity—are essential for understanding and organizing functional dependencies effectively, which aids in database normalization and minimizes redundancy.
Let’s go through these three main rules with examples and tables based on a Student database.
The Reflexivity Rule states that if a set of attributes Y is a subset of a set of attributes X, then X → Y holds. This means an attribute or a combination of attributes always determines itself or any subset of itself.
Notation: If Y ⊆ X, then X → Y.
Example: Consider the following Student table with attributes {Student_ID, Name, Course}.
Student_ID | Name | Course |
---|---|---|
101 | Alice Smith | Math |
102 | Bob Johnson | Science |
103 | Carol White | History |
In this table:
The reflexivity rule emphasizes that any attribute set inherently determines itself and any subset of its components.
The Augmentation Rule states that if X → Y holds, then adding an attribute Z to both sides of the dependency will still result in a valid dependency. This rule allows attributes to be added to a dependency without altering its validity.
Notation: If X → Y, then XZ → YZ (where XZ is the union of X and Z).
Example: Using the same Student table above, suppose we know that Student_ID → Name holds true, meaning that each Student_ID uniquely identifies a Name.
Now, let’s add Course to both sides:
This rule is especially useful when constructing complex dependencies that involve multiple attributes while ensuring no loss of information.
The Transitivity Rule is similar to the transitive property in mathematics. It states that if X → Y and Y → Z hold, then X → Z is also a valid dependency. Transitivity is crucial for identifying indirect dependencies that can contribute to redundancy if not properly managed.
Notation: If X → Y and Y → Z, then X → Z.
Example: Consider an expanded Student_Department table with the following attributes:
Student_ID | Department_ID | Department_Name |
---|---|---|
101 | D01 | Science |
102 | D02 | Arts |
103 | D03 | Commerce |
In this table, suppose the following dependencies hold:
By the transitivity rule:
This transitive dependency highlights the need to normalize data to reduce redundancy, as it indicates that storing Department_Name with Student_ID could result in unnecessary data duplication.
Rule | Definition | Example |
---|---|---|
Reflexivity | If Y is a subset of X, then X → Y | {Student_ID, Name} → Student_ID |
Augmentation | If X → Y, then XZ → YZ | If Student_ID → Name, then {Student_ID, Course} → {Name, Course} |
Transitivity | If X → Y and Y → Z, then X → Z | If Student_ID → Department_ID and Department_ID → Department_Name, then Student_ID → Department_Name |
.....
.....
.....