Professional Documents
Culture Documents
Radim Bača
radim.baca@vsb.cz
dbedu.cs.vsb.cz
Content
Motivation
Functional dependencies
Armstrong’s axioms
Closure of a set of attributes
Key
Minimal non-redundant functional dependencies
Example
Example
Example
Example
Each customer and each product are only once in the databse
Redundancy can be noticed in repeating foreign keys (for
different records), but the consistency of keys is checked by a
database system
Each customer and each product are only once in the databse
Redundancy can be noticed in repeating foreign keys (for
different records), but the consistency of keys is checked by a
database system
Example
Example
A dependency A → B is said to be
trivial if B ⊂ A
non-trivial if B 6⊂ A
totally non-trivial if B ∩ A = ∅
Armstrong’s Axioms
Decomposition of a FD
Consider A → B1 , ... , Bn
⇓
A → B1
A → B2
..
.
A → Bn
Decomposition of a FD
Consider A → B1 , ... , Bn
⇓
A → B1
A → B2
..
.
A → Bn
Union of FDs
Consider A → B1
A → B2
..
.
A → Bn
⇓
A → B1 , ... , Bn
Union of FDs
Consider A → B1
A → B2
..
.
A → Bn
⇓
A → B1 , ... , Bn
Augmentation of a FD
Consider A → B
⇓
AZ → BZ for any set Z
Augmentation of a FD
Consider A → B
⇓
AZ → BZ for any set Z
Transitivity of FDs
Consider A → B and
B→C
⇓
A→C
Transitivity of FDs
Consider A → B and
B→C
⇓
A→C
Closure - Algorithm
Algorithm:
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Algorithm
Algorithm:
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Closure - Example
X = A;
while X is modified do
if there is a dependency Y → B, where Y ⊂ X then
add B into X ;
end
A+ = X ;
end
Key
Redundant FDs
Redundant FDs
References