Module3 PartA
Module3 PartA
Functional Dependencies
Functional Dependency
A -> B
B is functionally dependent on A (or)
A functionally determines B
Eg : Customer_Id -> Customer_Name
Customer_Name is identified by Customer_Id.
i.e Customer_Name is functionally dependent on
Customer_Id.
Steps to Find Minimal Cover
AB -> CD
The above functional dependency should be
decomposed to singleton attributes in the RHS as
below.
AB -> C and
AB -> D
Attribute Closure
Example 1: Attribute Closure for one key attribute
Consider the Functional Dependencies for R(A, B, C)
A -> B
B -> C
A+ = Step1: AB [Since A -> B]
Step 2: ABC [Since B -> C]
B+ = Step1: BC [Since B -> C]
So,
A+ = ABC
B+ = BC
Note: If an attribute closure gives all the Attributes in the given
relation, that attribute will be a Candidate Key.
From the given set of functional dependencies,
A is a Candidate Key.
Attribute Closure
Example 2 : Attribute Closure for more than one
key attribute.
Consider the Functional Dependencies for R(A, B,
C,D,E,F) AB +
= ABCDE [Since AB->C, B->D, AD-
>E]
AB -> C
AD -> E AD+ = ADE [Since AD->E]
B -> D
AF -> B B+
= BCD [Since B->C, B->D]
B -> C
AF+ = AFBCDE [Since AF->B, B->C,B->D,
AB->C, AD->E]
From the given set of functional dependencies, AF is a
Candidate Key.
Attribute Closure
Example 3: Key Attribute closure without candidate
Key
Consider the Functional Dependencies for R(A, B, C,D,E)
A+ = ACB [Since A->C, C->B]
A -> C C+ = CB [Since C->B]
D+ = DE [Since D->E]
C-> B Since none of the key attribute closure have
D -> E issued all the attributes, try finding some other
closure by combining the key attributes which
may issue all the attributes in the
New
F= {A->D,
C->A,
C->B,
E->A,
E->D}
Finding Extraneous, Redundant
Dependency, Minimal Cover
Step3: Remove Redundant Dependency
A->D Remove C->B, C+ = CAD – Not Redundant [B not
C->A arrived]
C->B
E->A Remove E->A, E+ = ED – Not Redundant [A not
E->D arrived]
EC+ = ECADB
Thank You