Unit-3 FD
Unit-3 FD
(Unit 3)
Introduction – Functional Dependency
• A good relation (table) design is one, which has minimum redundancy and
minimum data dependency among the attributes of the relation (table).
• By minimizing the data dependency, we reduce the number of anomalies that
may occur when the database is used.
• Functional dependency is one of the core concept in the relational database
design theory
• In this unit we will study the concept of functional dependency, key identification
using functional dependencies, the equivalency of functional dependencies sets,
and canonical cover
2
Functional dependency in a relation (table)
3
Process to identify Functional Dependencies in
a given relation
• What kind of dependencies can we observe among the attributes in Relation R?
A→B, A→C, A→D, A→E (these are true as A is a key and unique for all tuples)
B→C (this is not true, as t1.B = t2.B but t1.C ≠ t2.C)
B→D (this is not true, as t1.B = t2.B but t1.D ≠ t2.D)
B→E (this is true, as t1.B = t2.B and t1.E = t2.E & t3.B = t4.B and t3.E = t4.E)
C→D (this is true, as t1.C = t3.C and t1.D = t3.D & t2.C = t4.C and t2.D = t4.D)
C→E (this is true, as t1.C = t3.C and t1.E = t3.E & t2.C = t4.C and t2.E = t4.E)
D→C (this is not true, as t1.D = t3.D = t5.D but t1.C = t3.C ≠ t5.C)
BC→D, BC→E, BC→A (these are true as BC is a key and unique for all tuples)
BD→E, BD→C, BD→A (these are true as BD is a key and unique for all tuples)
• We can use the above process to identify various functional dependencies in the
given Relation.
4
Functional Dependency- Example
Example
Assume we have an employee relation with attributes: EMPLOYEE Relation/Table
E-ID, E-NAME, E-CITY, E-STATE.
E-ID attribute can uniquely identify (determine) the E-NAME E-ID E-NAME E-CITY E-STATE
attribute of employee table because if we know the E-ID, we can E001 John Delhi Delhi
tell that employee name associated with it.
E002 Mary Delhi Delhi
Functional dependency can be written as:
E003 John Noida U.P.
E-ID → E-NAME
We can say that E-NAME is functionally dependent on E-ID.
Can we say?
E-NAME -> E-CITY
E-CITY -> E-STATE
Functional dependency in a relation (table)…
Example
• roll_no of the student can uniquely identify the first_name, middle_name, dob, gender etc.. of a student. The functional
dependency can be written as:
Roll_no → first_name
Roll_no → dob
Roll_no → gender
• One more functional dependency exists in the above Relation: city → state
• Can we say: city → pincode, from the current relation instance, we can say that this functional dependency exists,
however from a database design perspective, this might be a wrong assumption as bigger cities can have multiple pin
codes within them.
6
Types of functional dependencies
Functional dependencies can be classified into four types:
7
Trivial Functional Dependency
• In Trivial Functional Dependency, a dependent is always a subset of the determinant. i.e., If X→Y,
and Y is the subset of X, it is called trivial functional dependency.
• Trivial Functional Dependency occurs in a Composite Primary Key.
• Each attribute has a trivial functional dependency on itself.
19
Non-trivial Functional Dependency
• In Non-trivial functional dependency, the dependent is strictly not a subset of the determinant. i.e., If X→Y,
and Y is not a subset of X, then it is called Non-trivial functional dependency.
dept_id → dept_name is a non-trivial functional dependency, since the dependent dept_name is not a
subset of determinant dept_id.
Similarly, (dept_id, dept_name) → dept_location is also a non-trivial functional dependency, since
dept_location is not a subset of (dept_id, dept_name).
20
Transitive Functional Dependency
• In transitive functional dependency, the dependent is indirectly dependent on the determinant. i.e., If
X→Y, there exists a set of attributes Z in the Relation that is not a Candidate Key and both X→Z and Z→Y
hold, thus Y is transitively dependent on X.
• A transitive dependency can only occur in a Relation of three or more attributes.
21
Transitive Functional Dependency…
• Let’s assume a student relation as below.
The EMP relation with two MVDs: ENAME —>> PNAME and
ENAME —>> DNAME.
Types of MVD
Multivalued dependency categorized into two types such as:
• Trivial Multivalued dependency
• Non-trivial Multivalued dependency
Trivial Multivalued dependency Cont.…
• Trivial Multivalued Dependency –An MVD A →→ B on R is trivial if B⊆A or A ∪ B = R (i.e. A ∪ B is all attributes of R).
• It occurs when we have one multivalued attribute in a relation
Let’s take an example of a student relation, where we have one multivalued attribute sport which
contains the name of sports played by a student. (a student can play multiple sports)
In above relation Trivial Multivalued dependency occurs because there is one multivalued attribute i.e,
sports.
Non-trivial Multivalued dependency
• Non-trivial Multivalued Dependency - occurs when there are more than one independent multivalued attribute
in a Relation.
If a student relation has two (or more) multivalued attributes, sports ( a student can play multiple sports) and
clubs ( a student can be a part of multiple clubs), and these two attributes are independent of each other, this
creates a non-trivial multivalued dependency in a relation.
Example:
X = {a, b, c, d, e}
Y = {a, b, c}
2. Axiom of Augmentation:
Example:
For R(ABCD), if A → B then AC → BC
3. Axiom of Transitivity:
Example:
if (X→Y & Y→Z) then X→Z
Secondary Rules - Union
Proof:
1. X → Y (given)
2. X → Z (given)
3. X → XY (using Augmentation Rule on 1 by augmentation with X. Where XX = X)
4. XY → YZ (using Augmentation Rule on 2 by augmentation with Y)
5. X → YZ (using Transitive Rule on 3 and 4)
2. Decomposition
If X determines Y and Z, then X determines Y and X determines Z separately.
i.e, If X → YZ then X → Y and X → Z
Proof:
1. X → YZ (given)
2. YZ → Y (using Reflexivity Rule)
3. X → Y (using Transitive Rule on 1 and 2) ……….(i)
4. X → YZ (given)
5. YZ → Z (using Reflexivity Rule)
6. X → Z (using Transitive Rule on 4 and 5) ………..(ii)
3. Composition
If P holds Q (P → Q) and A holds B (A → B), then PA → QB.
Proof,
1.P → Q (Given)
2.A → B (Given)
3.PA → QA (Augmentation of 1 and A)
4.PA → Q (Decomposition of 3)
5.PA → PB (Augmentation of 2 and P)
6.PA → B (Decomposition of 5)
7.PA → QB (Union 4 and 6)
4. Pseudo Transitivity
In Pseudo transitive Rule, if X determines Y and YZ determines W, then XZ determines W.
Proof:
1. X → Y (given)
2. WY → Z (given)
3. WX → WY (using Augmentation Rule on 1 by augmenting with W)
4. WX → Z (using Transitive Rule on 3 and 2)
Types of Functional Dependency
• Full Functional Dependency: In a functional dependency A→B (A is a set of attributes and B is another set of
attributes), the dependency where B is fully dependent on A and not on any of the subsets of A is called Full
Functional dependency.
For example, assume that attributes P and Q together can only uniquely identify the value of the other
attribute R. Then, PQ→R is Full Functional Dependency.
• Partial Functional Dependency: A functional dependency A→B (A is a set of attributes and B is another set
of attributes) is said to be partial if any subset of A can still recognize B uniquely.
For example, in a functional dependency PQ→R, if either P alone or Q alone can uniquely identify R, this is
said to be Partial Functional Dependency. We read this as R is partially functionally dependent on P or R is
partially functionally dependent on Q.
Example:- let us consider the set F of functional dependencies for Relation R (A,B,C,D); F = {A→B, AD→B}.
In this case, the FD A→B is full functional dependency whereas AD→B is partial functional dependency;
i.e., B is not fully functionally dependent on AD; instead, it depends on A alone.
Attribute
• Attribute closure of anClosure
attribute set can be defined as a set of attributes that can be
functionally determined from it.
• The set of attributes that are functionally dependent on attribute A is called the attribute
closure of A and it can be represented as A+.
28
Attribute Closure…
Example - Find the attribute closures of Relation R(A,B,C,D,E) with functional dependency (FD) set F = {AB→C, B→D, C→E,
D→A}
To find B+, we will add an attribute in the set using various FD, which has been shown in steps below:
B+ = {B,D,A,C,E}
We can find (C, D)+ by adding C and D into the set (triviality) and then E using(C→E) and then A using (D→A)
(C,D)+ = {C,D,E,A}
Similarly, we can find (B, C)+ by adding B and C into the set (triviality) and then D using (B→D) and then E using (C→E) and then A
using (D→A)
(BC)+ = {B,C,D,E,A}
Closure of a Set of Functional Dependencies
Procedure to compute F+
F+=F
repeat
for each functional dependency f in F+
apply reflexive and augmentation rules on f
add the resulting dependencies to F+
for each pair of functional dependencies f1 and f2 in F+
if f1 and f2 can be combined using transitivity
add the resulting function dependencies to F+
Until F+ does not change any further
30
Example for finding FD closure
• Given a Relation schema R=(A,B,C,G,H,I) and set of Functional
dependencies
F={A->B, A->C, CG->H, CG->I, B->H}
from F, it is possible to derive following dependencies.
A->H (By using transitivity A->B, B->H)
CG->HI ( By using union CG->H, CG->I)
AG->I (By using Pseudo transitivity rule implies that AG->I)
AG->CG ( By using Augmentation rule X->Y, XZ->YZ)
Etc.
31
Identifying Keys in a Relation by using
Attribute
Definition Closure
of Super Key and Candidate Key (revisiting)
• Super Key - It is a set of attributes of a relation that can be used to identify a
tuple uniquely.
• Candidate Key - It is a minimal set of attributes of a relation that can be used to
identify a tuple uniquely.
Let us find the Super Keys of Relation R(A,B,C,D,E) with FD set F = {AB→C, B→E, C→D}
Now let us find attribute closure of all attributes individually and in combination to find the other possible Super
Keys.
In the above Relation R(A, B, C, D, E), we will have 25-1 = 31 possible combinations, which can be Super Keys.
Finding Super Keys of a relation using FD
Now sets and attribute
after computing the closures closure…
of all the possible combination of attributes of
Relation R(A,B,C,D,E) with FD set F = {AB→C, B→E, C→D}, the following Super
Keys have been found:
1. {A,B,C,D,E}
2. {A,B,D,E}
3. {A,B,C,E}
4. {A,B,C,D}
5. {A,B,E}
6. {A,B,D}
7. {A,B,C}
8. {A,B}
Finding Candidate Keys of a relation using
called theFD sets andRelation.attribute closure…
As per the definition of Candidate Key - The minimal set of attributes whose attribute closure is a set of all attributes of Relation is
Candidate Key of the This means that a Super Key whose proper subset is not a Super Key is a Candidate
Key.
Now, if we look at the list of Super Keys, which we have found for Relation R(A,B,C,D,E), none of the Super Keys have a proper
subset which is not a Super Key except {A,B}.
For example –
• Super Key {A,B,C,D,E} – attribute {A,B} is a proper subset of this Super Key and it is itself a Super Key, so
{A,B,C,D,E} can’t be a Candidate Key
• Super Key {A,B,C,E} - attribute {A,B} is a proper subset of this Super Key and it is itself a Super Key, so {A,B,C,E}
can’t be a Candidate Key
• Super Key {A,B,D} - attribute {A,B} is a proper subset of this Super Key and it is itself a Super Key, so {A,B,D} can’t
be a Candidate Key
• Super Key {A,B} - attribute {A} & {B} are proper subset of this Super Key, but neither {A} nor {B} is itself a Super
Key, so {A,B} is a Candidate Key
So (A,B) is Candidate Key for Relation R(A,B,C,D,E) with FD set F = {AB→C, B→E, C→D}
Prime attributes and non-prime attributes
The attributes of a Relation that are part of Candidate Keys are called Prime
Attributes, and the remaining attributes are called Non-Prime Attributes.
Therefore the given Relation has two Candidate Keys – (BC) & (DC)
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 4
Let R(A,B,C,D,E) be a Relation schema with the following FDs: AB→CD, D→A, BC→DE
The FDs can be re-written as below using Armstrong’s Axiom of decomposition:
AB→C, AB→D, D→A, BC→D, BC→E
Essential attributes – B
Let us take attribute closure of essential attributes:-
(B)+= {B}
So, we can see that the closure of essential attributes does not return all attributes of the Relation.
So, we can conclude that though {B} is an essential element of any Candidate Key, however, it is not a Candidate Key.
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 4 (contd.)
Let us take the Relation R(A,B,C,D,E) and start discarding the dependent attributes.
(ABCDE)+ = {A,B,C,D,E}
(ABE)+ = {A,B,C,D,E} – discarding C & D as they can be determined by A & B
So, (ABE) is a Super Key – To check if it is a Candidate Key, its proper subsets should not be Super Keys.
(AB) & (BE) are proper subsets of (ABE), not considering subset AE as B is an essential attribute
(AB)+ = {A,B,C,D,E} ----- is a Super Key, so (ABE) cannot be a Candidate Key
(BE)+ = {B,E} -----so not a Super Key
(AB) can be a Candidate Key if its proper subsets (A) & (B) are not Super Keys
(A)+ = {A} -----so not a Super Key
(B)+ = {B} -----so not a Super Key
Therefore, (AB) is a Candidate Key.
Short Cut for finding candidate keys using
Example 4 (contd.)
FD sets and attribute closure…
To check if there are any more Candidate Keys – Check if already identified prime attributes (A) & (B) are on RHS and
can be replaced by its determinant.
We can see that A can be replaced by D, so we need to check if (DB) is a Candidate Key as per the above process. We
will find that (DB) is also a Candidate Key.
To check if there are any more Candidate Keys – Check if already identified prime attributes (A), (B) & (D) are on RHS
and can be replaced by its determinant.
We can see that D can be replaced by BC, so we need to check if (CB) is a Candidate Key as per the above process.
We will find that (CB) is also a Candidate Key.
Therefore the given Relation has three Candidate Keys – (AB), (BC), (BD)
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 5
Let R (W,X,Y,Z) be a Relation schema with the following FDs: Z→W, Y→XZ, WX→Y
The FDs can be re-written as below using Armstrong’s Axiom of decomposition:
Z→W, Y→X, Y→Z, WX→Y
Essential attributes – NIL
Let us take the Relation R(W,X,Y,Z) and start discarding the dependent attributes.
(WXYZ)+ = {W,X,Y,Z}
(YZ)+ = {W,X,Y,Z} – discarding W & X as they can be determined by Y & Z respectively
So, (YZ) is a Super Key – To check if it is a Candidate Key, its proper subsets should not be Super Keys.
(Y) & (Z) are proper subsets of (YZ)
(Y)+ = {Y,X,Z,W} ----- is a Super Key, so (YZ) cannot be a Candidate Key
(Z)+ = {Z,W} -----so not a Super Key
(Y) is a Candidate Key as it is a minimal set with no proper subsets.
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 5 (contd.)
To check if there are any more Candidate Keys – Check if the already identified prime attribute (Y) is on RHS and can
be replaced by its determinant.
We can see that Y can be replaced by WX (WX→Y), so we need to check if (WX) is a Candidate Key as per the above
process. We will find that (WX) is also a Candidate Key.
To check if there are any more Candidate Keys – Check if already identified prime attributes (Y), (W) & (X) are on
RHS and can be replaced by its determinant. We can see that W can be replaced by Z (Z→W), so we need to check if
(ZX) is a Candidate Key as per the above process. We will find that (ZX) is also a Candidate Key.
To check if there are any more Candidate Keys – Check if already identified prime attributes (Y), (W), (X) & (Z) are on
RHS and can be replaced by its determinant.
We can see that X can be replaced by Y (Y→X), Z can be replaced by Y (Y→Z), so we need to check if (ZY), (WY), (YX)
are Candidate Keys as per the above process. As (ZY), (WY) & (YX) have (Y) as a proper subset, and we found that (Y)
is a Candidate Key (or a Super Key), so (ZY), (WY) & (YX) will not be Candidate Keys.
Therefore the given Relation has three Candidate Keys – (Y), (WX), (ZX)
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 6
Let R(A,B,C) be a Relation schema with the following FDs: A→B, B→A
Essential attributes – C
Let us take attribute closure of essential attributes:-
(C)+= {C}
So, we can see that the closure of essential attributes does not return all attributes of the Relation.
So, we can conclude that though {C} is an essential element of any Candidate Key; however, it is not a Candidate
Key.
Let us take the Relation R (ABC) and start discarding the dependent attributes.
(ABC)+ = {A,B,C}
(AC)+ = {A,C,B} – discarding B as it can be determined A
So, (AC) is a Super Key – To check if it is a Candidate Key, its proper subsets should not be Super Keys.
Short Cut for finding candidate keys using
FD sets and attribute closure…
Example 6 (contd.)
(A) & (C) are proper subsets of (AC)
(A)+ = {A,B} ----- so not a Super Key
(C)+ = {C} -----so not a Super Key
Therefore (AC) is a Candidate Key – B, C are prime attributes.
To check if there are any more Candidate Keys – Check if already identified prime attributes are on RHS and can be
replaced by its determinant.
Therefore the given Relation has two Candidate Keys – (AC) & (BC)
Equivalence of Sets of Functional
Dependencies
If we have two sets of FDs, FD1 & FD2, for a given Relation R, we will discuss how to find the relationship between two FD sets.
1. If all FDs of FD1 can be derived from FDs present in FD2, we can say that FD2 ⊃ FD1.
2. If all FDs of FD2 can be derived from FDs present in FD1, we can say that FD1 ⊃ FD2.
3. If 1 and 2 both are true, FD1 ≡ FD2.
Equivalence of Sets of Functional
Dependencies…
How to determine whether FD1 covers FD2 –
1. Calculate the closure of LHS (left-hand side) in FD2, for each FD in FD2, with
respect to FDs in FD1. If the closure includes the attributes on the RHS (right-
hand side), this FD will hold in FD1.
2. If this is the case for every FD in FD2, then FD1 covers FD2.
3. We determine whether FD2 and FD1 are equivalent by checking that FD2 covers
FD1 and FD1 covers FD2 by using the above process.
Equivalence of Sets of Functional
Example
Dependencies…
A Relation R(A,B,C,D,E) has the following two sets of FDs, find if they are equivalent:
FD1 = {A→C, AC→D, E→AD, E→H}
FD2 = {A→CD, E→AH}
Find closure of LHS all FDs in FD2, with respect to FDs in FD1, and see if the closure returns the attributes on RHS.
(A)+ = {A,C,D} – the closure includes (C) & (D), thus A→CD holds in FD1 also.
(E)+ = {E,A,D,H} – the closure includes (A) & (H), thus E→AH holds in FD1 also.
As we can see that all FDs of FD2 hold in FD1 also; thus, FD1 covers FD2 (FD1 ⊃ FD2)
Equivalence of Sets of Functional
Dependencies…
Example (contd.)
Step 2 – Check if FD2 covers FD1.
Find closure of LHS all FDs in FD1, with respect to FDs in FD2, and see if the closure returns the attributes on RHS.
(A)+ = {A,C,D} – the closure includes (C), thus A→C holds in FD2 also.
(AC)+ = {A,C,D} – the closure includes (D), thus AC→holds in FD2 also.
(E)+ = {E,A,H,C,D} – the closure includes (A) & (D), thus E→AD holds in FD2 also.
(E)+ = {E,A,H,C,D} – the closure includes (H), thus E→H holds in FD2 also.
As we can see that all FDs of FD1 hold in FD2 also; thus, FD2 covers FD1 (FD2 ⊃ FD1)
As, FD1 covers FD2 (FD1 ⊃ FD2) & FD2 covers FD1 (FD2 ⊃ FD1), therefore FD1 is equivalent to FD2 (FD1 = FD2).
Canonical Cover or Minimal Set of Functional
We canDependency
define a set of functional dependencies FD to be minimal (canonical cover) if it satisfies
the following conditions:
1. Every dependency in FD has a single attribute for its right-hand side.
2. We cannot remove any dependency from FD and still have a set of dependencies equivalent
to FD.
3. On the left-hand side (LHS) of any functional dependency (FDs remaining after condition two
is met), we should not have any extraneous attribute (applicable when LHS has more than
one attribute). An attribute of a functional dependency is extraneous if we can remove it
without changing the closure of the set of functional dependencies.
Canonical Cover or Minimal Set of Functional
ExampleDependency…
1:
Find the canonical cover of a relational schema R(A,B,C,D) with a set of FDs = {B→A, AD→BC, C→ABD}
Condition 1
Given FD = {B→A, AD→BC, C→ABD} to be decomposed using Armstrong Axiom’s decomposition rule.
B→A
AD→B ( using decomposition inference rule on AD→BC)
AD→C ( using decomposition inference rule on AD→BC)
C→A ( using decomposition inference rule on C→ABD)
C→B ( using decomposition inference rule on C→ABD)
C→D ( using decomposition inference rule on C→ABD)
Now set of FD = {B→A, AD→B, AD→C, C→A, C→B, C→D}
Canonical Cover or Minimal Set of Functional
ExampleDependency…
1 (contd.)
Condition 2
Calculating closure of all FD {B→A, AD→B, AD→C, C→A, C→B, C→D}
1. (B)+
a) Closure (B)+ = {B,A} using FD = {B→A, AD→B, AD→C, C→A, C→B, C→D}
b) Closure (B)+ = {B} using FD = {AD→B, AD→C, C→A, C→B, C→D}
From 1 a and 1 b, we found that both the Closure( by including B→A and excluding B→A ) are not equivalent;
hence FD B→A is important and cannot be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→A, C→B, C→D}
2. (AD)+
a) Closure (AD)+ = {A,D,B,C} using FD = {B→A, AD→B, AD→C, C→A, C→B, C→D}
b) Closure (AD)+ = {A,D,C,B} using FD = {B→A, AD→C, C→A, C→B, C→D}
From 2 a and 2 b, we found that both the Closure (by including AD→B and excluding AD→B) are equivalent;
hence FD AD→B is not important and can be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→A, C→B, C→D}
Canonical Cover or Minimal Set of Functional
Dependency…
Example 1 (contd.)
3. (AD)+
a) Closure (AD)+ = {A,D,C,B} using FD = {B→A, AD→C, C→A, C→B, C→D}
b) Closure (AD)+ = {A,D} using FD = {B→A, C→A, C→B, C→D}
From 3 a and 3 b, we found that both the Closure (by including AD→C and excluding AD→C ) are not
equivalent; hence FD AD→C is important and cannot be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→A, C→B, C→D}
4. (C)+
a) Closure (C)+ = {C,A,B,D} using FD = {B→A, AD→C, C→A, C→B, C→D}
b) Closure (C)+ = {C,B,D,A} using FD = {B→A, AD→C, C→B, C→D}
From 4 a and 4 b, we found that both the Closure (by including C→A and excluding C→A) are equivalent; hence
FD C→A is not important and can be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→B, C→D}
Canonical Cover or Minimal Set of Functional
Dependency…
Example 1 (contd.)
5. (C)+
a) Closure (C)+ = {C,B,D,A} using FD = {B→A, AD→C, C→B, C→D}
b) Closure (C)+ = {C,D} using FD = {B→A, AD→C, C→D}
From 5 a and 5 b, we found that both the closure (by including C→B and excluding C→B) are not equivalent;
hence FD C→B is important and cannot be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→B, C→D}
6. (C)+
a) Closure (C)+ = {C,D,B,A} using FD = {B→A, AD→C, C→B, C→D}
b) Closure (C)+ = {C,B,A} using FD = {B→A, AD→C, C→B}
From 6 a and 6 b, we found that both the Closure( by including C→D and excluding C→D) are not equivalent,
hence FD C→D is important and cannot be removed from the set of FD.
Hence resultant FD = {B→A, AD→C, C→B, C→D}
Canonical Cover or Minimal Set of Functional
Dependency…
Example 1 (contd.)
Condition 3
Since FD = {B→A, AD→C, C→B, C→D} is resultant FD, now we have to check the redundancy of attributes on LHS;
since the left side of FD AD→C has two attributes, let us check their importance, i.e., whether they both are
important or only one.
(AD)+ = {A,D,C,B} using FD = {B→A, AD→C, C→B, C→D}
(A)+ = {A} using FD = {B→A, AD→C, C→B, C→D}
(D)+ = {D} using FD = {B→A, AD→C, C→B, C→D}
Since the (AD)+, (A)+, (D)+ that we found are not all equivalent, hence in FD AD→C, both A and D are important
attributes and cannot be removed.
Hence resultant FD = {B→A, AD→C, C→B, C→D} and we can rewrite as
FD = {B→A, AD→C, C→BD} is Canonical Cover of FD = {B→A, AD→BC, C→ABD}.
Canonical Cover or Minimal Set of Functional
ExampleDependency…
2:
Find canonical cover for a relational Schema R(V,W,X,Y,Z) and set of FDs = {V→W, VW→X, Y→VXZ}.
Condition 1
Given FD = {V→W, VW→X, Y→VXZ} to be decomposed using Armstrong Axiom’s decomposition rule.
V→W
VW→X
Y→V ( using decomposition inference rule on Y→VXZ )
Y→X ( using decomposition inference rule on Y→VXZ )
Y→Z ( using decomposition inference rule on Y→VXZ )
65