Presentation is loading. Please wait.

Presentation is loading. Please wait.

Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover.

Similar presentations


Presentation on theme: "Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover."— Presentation transcript:

1 Normal Form Design addendum by C. Zaniolo

2 ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover C Decompose the original relation into a set of 3NF relations that have the following properties  Preservation of the fds in C  Lossless Join property  Minimal number of relations The relations so obtained are 3NF; you should now check if they are also BCNF.

3 ©Silberschatz, Korth and Sudarshan7.3Database System Concepts Canonical Cover for F Let F be a set of fds. Every F' that  is a subset of F, and  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. Canonical covers: minimal covers where the FDs have only one attribute on their right side and no extraneous attribute on their right side. Minimal covers are not unique. Canonical covers are not unique either, but they all produce good schemas (lossless join property, preservation of fds, minimal number of relations)

4 ©Silberschatz, Korth and Sudarshan7.4Database System Concepts Canonical Cover Algorithm Canonical Cover Algorithm 1.Decompose fds into non-trivial fds that have only one attribute at the right side. 2.Reduce left sides by removing extraneous attributes: For each X  A  F, where B  X and X-{B}  A is implied by F, replace X  A with X-{B}  A. 3.Eliminate redundant fds. An fd f  F is redundant if f is implied by F-{f}. Expediting notes: * An fd can be redundant only if there exist another fd with same left side; * If an fd is not redundant in the original set, it cannot be redundant in the sets obtained in later steps

5 ©Silberschatz, Korth and Sudarshan7.5Database System Concepts 3NF Decomposition of a relation r(U) Let C be a canonical cover, then we have three steps: A.Preservation of the fds of r(U): Compute S as follows S = { X U {A} | X  A  C } B. Lossless Join Property: If the key of some relation in S is also the key of the original relation r(U), then we are done. Otherwise, add W to S, where W is a key for r(U). C.Minimize the count of the relations produced: 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  Y. Repeat this step while applicable.

6 ©Silberschatz, Korth and Sudarshan7.6Database System Concepts Checking for BCNF If Every fd has a key as its left side, we have BCNF Otherwise we don’t. Then decomposition will reduce to BCNF but it not always an improvement. 


Download ppt "Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover."

Similar presentations


Ads by Google