Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relational Design Theory

Similar presentations


Presentation on theme: "Relational Design Theory"— Presentation transcript:

1 Relational Design Theory
Boyce-Codd Normal Form

2 Relational design by decomposition
BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties Final set of relations satisfies normal form No anomalies, no lost information Functional dependencies  Boyce-Codd Normal Form Multivalued dependences  Fourth Normal Form

3 Decomposition of a relational schema
BCNF Decomposition of a relational schema

4 Decomposition Example #1
BCNF Decomposition Example #1 Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority)

5 Decomposition Example #2
BCNF Decomposition Example #2 Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority)

6 Relational design by decomposition
BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties “Good” decompositions only Into “good” relations

7 Boyce-Codd Normal Form
BCNF Boyce-Codd Normal Form Relation R with FDs is in BCNF if: For each Ᾱ  B, Ᾱ is a key

8 BCNF? Example #1 Student(SSN, sName, address,
HScode, HSname, HScity, GPA, priority) SSN  sName, address, GPA GPA  priority HScode  HSname, HScity

9 BCNF? Example #2 Apply(SSN, cName, state, date, major)

10 Relational design by decomposition
BCNF Relational design by decomposition “Mega” relations + properties of the data System decomposes based on properties “Good” decompositions only Into “good” relations

11 BCNF decomposition algorithm
Input: relation R + FDs for R Output: decomposition of R into BCNF relations with “lossless join” Compute keys for R Repeat until all relations are in BCNF: Pick any R’ with A  B that violates BCNF Decompose R’ into R1(A, B) and R2(A, rest) Compute FDs for R1 and R2 Compute keys for R1 and R2

12 BCNF Decomposition Example
Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) SSN  sName, address, GPA GPA  priority HScode  HSname, HScity

13 BCNF decomposition algorithm
Input: relation R + FDs for R Output: decomposition of R into BCNF relations with “lossless join” Compute keys for R Repeat until all relations are in BCNF: Pick any R’ with A  B that violates BCNF Decompose R’ into R1(A, B) and R2(A, rest) Compute FDs for R1 and R2 Compute keys for R1 and R2

14 Does BCNF guarantee a good decomposition?
Removes anomalies? Can logically reconstruct original relation? Too few or too many tuples?

15 Does BCNF guarantee a good decomposition?
Removes anomalies? Can logically reconstruct original relation? Too few or too many tuples? Some shortcomings discussed in later video


Download ppt "Relational Design Theory"

Similar presentations


Ads by Google