Suppose I have the following relationship
C -> B
CB -> AC
CAE -> FB
D -> E
CA -> B
Canonical cover given in my book is C -> AB, CE -> F, D -> E
But Canonical cover can also be C - AB, D - EF?
Can we have two different canonical cover for one relationship?
But Canonical cover can also be
C - AB
,D - EF
?
No, it cannot be a canonical cover for your set of functional dependencies (FD). A canonical cover of F is a “minimal” set of functional dependencies equivalent to F, having no redundant dependencies or redundant parts of dependencies.
The canonical cover you suggest is not equivalent to F
. For instance the functional dependency CAE->FB
is not fully covered in the canonical cover suggested by you and hence it is not a canonical cover.
On the other hand the one given in your book C -> AB, CE -> F, D -> E
is a canonical cover and the only canonical cover possible for this set of FD's.
Can we have two different canonical cover for one relationship?
Yes we can. To find canonical cover we do -
We can have different canonical cover for one relationship because of the third step above. I will explain this with an example.
Given FD's as:
X→YZ
Y→XZ
Z→XY
First ensure singleton RHS. So we have :
Second No extraneous LHS. Already satisfied.
Third Remove any redundant FD. Now we can remove (2),(3) and (6) as redundant dependencies and have the minimal cover set as:
1:
X→Y,
Y→Z,
Z→X
or we can remove (1),(4) and (5) as redundant dependencies and have the minimal cover set as:
2:
Z→Y,
Y→X,
X→Z
Hence, in this case we have two canonical covers for the same relationship.