0
0
DBMS Theoryknowledge~6 mins

Armstrong's axioms in DBMS Theory - Full Explanation

Choose your learning style9 modes available
Introduction
When working with databases, it can be tricky to figure out all the rules that connect different pieces of data. Armstrong's axioms help us find all the logical rules about how data depends on each other, so we can organize data better and avoid mistakes.
Explanation
Reflexivity
If you have a set of data attributes, any attribute or group of attributes in that set can be said to depend on itself or on a smaller part of that set. This means if you know some data, you automatically know any part of it.
Any set of attributes always determines its own subsets.
Augmentation
If a certain set of data attributes determines another set, then adding more attributes to both sets keeps the dependency true. This means you can add extra information to both sides without breaking the rule.
Adding the same attributes to both sides of a dependency keeps it valid.
Transitivity
If one set of data determines a second set, and that second set determines a third set, then the first set also determines the third set. This helps us chain dependencies together to find new ones.
Dependencies can be combined through a chain to find new dependencies.
Real World Analogy

Imagine you have a recipe book. If knowing the recipe name tells you the list of ingredients, and knowing the ingredients tells you the cooking steps, then knowing the recipe name also tells you the cooking steps.

Reflexivity → Knowing a recipe name means you know the recipe name itself or parts of it.
Augmentation → If knowing the recipe name tells you the ingredients, then knowing the recipe name plus the cooking time also tells you the ingredients plus the cooking time.
Transitivity → If knowing the recipe name tells you the ingredients, and ingredients tell you the cooking steps, then the recipe name tells you the cooking steps.
Diagram
Diagram
┌─────────────┐       ┌─────────────┐       ┌─────────────┐
│   Set A     │──────▶│   Set B     │──────▶│   Set C     │
└─────────────┘       └─────────────┘       └─────────────┘
       │                                         ▲
       │                                         │
       └─────────────────────────────────────────┘
This diagram shows how Set A determines Set B, Set B determines Set C, and therefore Set A determines Set C by transitivity.
Key Facts
Armstrong's axiomsA set of rules used to infer all functional dependencies in a database.
ReflexivityIf a set of attributes contains another set, it functionally determines that set.
AugmentationAdding attributes to both sides of a dependency preserves the dependency.
TransitivityIf A determines B and B determines C, then A determines C.
Code Example
DBMS Theory
def reflexivity(X, Y):
    return set(Y).issubset(set(X))

def augmentation(X, Y, Z):
    return (set(X).union(set(Z)), set(Y).union(set(Z)))

def transitivity(X, Y, Z):
    # If X->Y and Y->Z then X->Z
    return (X, Z)

# Example usage
X = {'A', 'B'}
Y = {'B'}
Z = {'C'}
print('Reflexivity:', reflexivity(X, Y))
aug_X, aug_Y = augmentation(X, Y, {'D'})
print('Augmentation:', aug_X, '->', aug_Y)
print('Transitivity:', transitivity({'A'}, {'B'}, {'C'}))
OutputSuccess
Common Confusions
Thinking augmentation allows adding attributes only to one side of the dependency.
Thinking augmentation allows adding attributes only to one side of the dependency. Augmentation requires adding the same attributes to both sides to keep the dependency valid.
Believing reflexivity means any attribute determines any other attribute.
Believing reflexivity means any attribute determines any other attribute. Reflexivity only applies when the determined set is a subset of the determining set.
Assuming transitivity works without the middle dependency being valid.
Assuming transitivity works without the middle dependency being valid. Transitivity only applies if the middle dependency (B determines C) is true.
Summary
Armstrong's axioms help find all logical rules about how data depends on each other in databases.
The three main axioms are reflexivity, augmentation, and transitivity, each describing a way dependencies work.
Understanding these axioms helps organize data better and avoid errors in database design.