Algorithm |
Example |
that have the following properties |
Let r(A, B, C, D, E, F) be a relation with the following fds:
|
Canonical CoverLet F be a set of fds. Every F' that is a subset of F and that implies all the fds in F is said to be a cover for F. If no proper subset of F' is a cover for F, then F' is said to be a minimal cover for F. Minimal covers are not unique: for 3NF design we use a particular kind of minimal cover, called a canonical cover. Canonical covers are computed as follows:
(an fd can be redundant only if there exist another fd with the same left side; if an fd is not redundant in the original set, it cannot be redundant in later steps) |
Step 1. Decompose fds. No change
Step 2. Reduce left side: fds with only one attribute on the left side
need not be considered .
Now A+ = {ABDC}. Thus 1, can be replace by (a). Step3: Eliminate redundant fds
is 2 redundant? A+ = {A}: 2 is not redundant, is 3 redundant B+ = {B}: 3 is not redundant, is 4 redundant? C+ = {C}: 4 is not redundant, is 5 redundant? D+ = {D}: D is not redundant. |
Decomposition of relation r(U)
Compute S as follows S = {X È {A} | X ![]() If the key of some relation in S is also the key of the original relation r(U) we are done. Otherwise, add W, where W is a key of the original relation. Join any two relations in S whose keys are in one-to-one correspondence. Thus if X is the key for the first relation and Y the key for the second one, it must be that X ![]() ![]() |
with respective keys: A, B, C, and D (also undescored) Now merging relations with equivalent keys: D
![]() ![]() |
Checking for BCNF | Every fd has a key as its left side.
Thus we have BCNF |