jennifer widom relational design theory shortcomings of bcnf/4nf

8
Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Upload: shawn-mccarthy

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Jennifer Widom Example: College application info. Apply(SSN, cName, date, major) Can apply to each college once for one major Colleges have non-overlapping application dates FDs: Keys: BCNF: Good design? Shortcomings of BCNF/4NF

TRANSCRIPT

Page 1: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Relational Design TheoryShortcomings of BCNF/4NF

Page 2: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Boyce-Codd Normal FormRelation R with FDs is in BCNF if: For each A B, A is a key

Fourth Normal FormRelation R with MVDs is in 4NF if: For each nontrivial A B, A is a key

Shortcomings of BCNF/4NF

Page 3: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Example: College application info.Apply(SSN, cName, date, major)Can apply to each college once for one majorColleges have non-overlapping application dates

FDs:Keys:

BCNF:

Good design?

Shortcomings of BCNF/4NF

Page 4: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Example #2Student(SSN, HSname, GPA, priority)Multiple HS okay, priority determined from GPA

FDs:Keys:

BCNF:

Good design?

Shortcomings of BCNF/4NF

Page 5: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Boyce-Codd Normal FormRelation R with FDs is in BCNF if: For each A B, A is a key

Fourth Normal FormRelation R with MVDs is in 4NF if: For each nontrivial A B, A is a key

After decomposition, no guarantee dependencies can be checked on

decomposed relations

Shortcomings of BCNF/4NF

Page 6: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Example #3Scores(SSN, sName, SAT, ACT)

Multiple SATs and ACTs allowedAll queries return name + composite score for SSN

FDs + keys:

MVDs:

4NF:

“Denormalized”relation

Shortcomings of BCNF/4NF

Page 7: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Example #4College(cName, state)CollegeSize(cName, enrollment)CollegeScores(cName, avgSAT)CollegeGrades(cName, avgGPA)

BCNF/4NF?Good Design?

Shortcomings of BCNF/4NF

“Too decomposed”

Page 8: Jennifer Widom Relational Design Theory Shortcomings of BCNF/4NF

Jennifer Widom

Designing a database schema Usually many designs possible Some are (much) better than others! How do we choose?

Very nice theory for relational database design Normal forms “good” relations Design by decomposition Usually intuitive and works well Some shortcomings

Dependency enforcement Query workload Over-decomposition

Shortcomings of BCNF/4NF