FD Closure MinimalCover Equal NormalForms
FD Closure MinimalCover Equal NormalForms
• To check Y covers X:
• A+={A,C,D} contains C
• { A,C}+={A,C,D} contains D
• E+={A,C,D,E,H} contains A,D,H
• So Y also covers X.
• Hence X and Y are equivalent.
Determines Normal forms from FD
• Steps to find the highest normal form of relation:
1.Find all possible candidate keys of the relation.
2.Divide all attributes into two categories: prime attributes and
non-prime attributes.
3.Check for 1st normal form then 2nd and so on. If it fails to satisfy
the nth normal form condition, the highest normal form will be n-
1.
• Partial Dependency – If the proper subset of candidate key
determines non-prime attribute, it is called partial dependency.
Determines Normal forms from FD
• Every FD is 1st normal Form because RDBMS don’t allowed
multivalued and composite attribute
• For 2nd normal form- No Partial Dependency
• When Left side is superkey
• Left side should not be proper subset of Candidate key which determines non
prime key attribute
• For 3rd normal form- No Transitive dependency
• When Left side should be Superkey
• When Left side is not be superkey then right side should be prime attribute.
Example 1
• Find the highest normal form of a relation
• R(A,B,C,D,E)
• FD ={BC->D, AC->BE, B->E}
• Step 1. As we can see, (AC)+ ={A,C,B,E,D} but none of its
subset can determine all attribute of relation, So AC will be
candidate key. A or C can’t be derived from any other attribute
of the relation, so there will be only 1 candidate key {AC}.
Example 1
R(A,B,C,D,E)
FD ={BC->D, AC->BE, B->E}
• Step 2. Prime attributes are those attributes that are part of candidate key
{A, C} in this example and others will be non-prime {B, D, E} in this
example.
• Step 3. The relation R is in 1st normal form as a relational DBMS does not
allow multi-valued or composite attribute.
• The relation is in 2nd normal form because BC->D is in 2nd normal form
(BC is not a proper subset of candidate key AC) and AC->BE is in 2nd
normal form (AC is candidate key) and B->E is in 2nd normal form (B is
not a proper subset of candidate key AC).
• The relation is not in 3rd normal form because in BC->D (neither BC is a
super key nor D is a prime attribute) and in B->E (neither B is a super key
nor E is a prime attribute) but to satisfy 3rd normal for, either LHS of an FD
should be super key or RHS should be prime attribute.
So the highest normal form of relation will be 2nd Normal form.
Example 2
• Find the highest normal form of a relation
• R(A,B,C,D,E)
• FD = {A->D, B->A, BC->D, AC->BE}
• Solution
• Step 1: two candidate keys {AC, BC}.
• Step 2. The prime attribute {A, B, C}
• non-prime {D, E}
Example 2
R(A,B,C,D,E)
FD = {A->D, B->A, BC->D, AC->BE}
• Step 3. The relation R is in 1st normal form as a relational
DBMS does not allow multi-valued or composite attributes.
• The relation is not in the 2nd Normal form because A->D is
partial dependency (A which is a subset of candidate key AC is
determining non-prime attribute D) and the 2nd normal form
does not allow partial dependency.
Example 3
• Find the highest normal form of a relation
• R(A,B,C,D,E)
• FD ={BC->D, AC->BE, B->E}
• Solution:
• Step 1: candidate key {AC}.
• Step 2. The prime attribute {A,C}
• non-prime {B,D,E} in this example.
Example 3
R(A,B,C,D,E)
FD ={BC->D, AC->BE, B->E}
• Step 3. The relation R is in 1st normal form as a relational DBMS
does not allow multi-valued or composite attributes.
• The relation is in 2nd normal form because BC->D is in 2nd normal
form (BC is not a proper subset of candidate key AC) and AC->BE is
in 2nd normal form (AC is candidate key) and B->E is in 2nd normal
form (B is not a proper subset of candidate key AC).
• The relation is not in 3rd normal form because in BC->D (neither BC
is a super key nor D is a prime attribute) and in B->E (neither B is a
super key nor E is a prime attribute) but to satisfy 3rd normal for,
either LHS of an FD should be super key or RHS should be a prime
attribute.
• So the highest normal form of relation will be the 2nd Normal form.