DBMS
DBMS
Lecture 30
Normalization
Attribute Closure
Closure of a set of FDs (Attribute Closure)
1. The closure of a set of FDs is the set of all FDs implied by a given set
of FDs.
2. It can be calculated using Armstrong Axioms.
3. It can be used to check if a FD follows from a given set.
4. Can check if a set of attributes is a candidate key.
So (AG)+ = ABCGHI.
Since (AG)+ contains all the attributes of relation R so AG is the key of R.
Dinesh Kumar Bhawnani, BIT DURG
Q.2 What is closure of attributes, give the algorithm for it with given relation R
(A, B, C, D, E, F) and following set of functional dependencies.
A BC, E CF, B E, CD EF
(i) Computer (AB)+.
(ii) Is AC CF implied by above FD’s?
Sol : Given relation R (A, B, C, D, E, F) and set of functional dependencies are
A BC, E CF, B E, CD EF, so to find (AB)+.
Iteration Using Result (AB)+ Old (AB)+
1 AB AB
2 A BC ABC AB
3 BE ABCE AB
4 E CF ABCEF AB
5 ABCEF ABCEF
So (AB)+ = ABCEF.
Dinesh Kumar Bhawnani, BIT DURG
Q.2 What is closure of attributes, give the algorithm for it with given relation R
(A, B, C, D, E, F) and following set of functional dependencies.
A BC, E CF, B E, CD EF
(i) Computer (AB)+.
(ii) Is AC CF implied by above FD’s?
Sol : Now to check whether AC CF is implied by FDs we need to find (AC)+.
Iteration Using Result (AC)+ Old (AC)+
1 AC AC
2 A BC ABC AC
3 BE ABCE AC
4 E CF ABCEF AC
5 ABCEF ABCEF
So (AB)+ = ABC. Since (AB)+ do not contain all the attribute of this relation, AB is not a
candidate key of this relation.
So (ABD)+ = ABCDE. Since (ABD)+ contains all the attribute of this relation, ABD is a
candidate key of this relation.
Dinesh Kumar Bhawnani, BIT DURG
Q.4 Let the relation :
R = {A, B, C, D, E, F, G} satisfies following FD’s
Let F = {A B, BC DE, AEF G, B F}
Find A+, BC+, AEF+.
Q.5 Let the relation
R (A, B, C, D, E, F, G)
Satisfies the following FD’s
A B,
BC DE,
AEF G
Compute the closure {A, C}+.
Is the FD ACF DG implied by this set.
https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub
_confirmation=1