Stuff ithink that will be on the quiz midterm
Download
1 / 21

ink - PowerPoint PPT Presentation


  • 336 Views
  • Updated On :

Stuff iThink that will be on the Quiz/Midterm. Fourth Normal Form by Andrew Yee Why 4NF? Performance We want database to take up less space. Why 4NF? To eliminate the possibility for data anomalies. Why 4NF? To reduce the need for: inserts, updates deletes Normal Forms Comparison

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'ink ' - paul2


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Stuff ithink that will be on the quiz midterm l.jpg

Stuff iThinkthat will be on the Quiz/Midterm.

Fourth Normal Form

by Andrew Yee


Why 4nf l.jpg
Why 4NF?

  • Performance

    • We want database to take up less space.


Why 4nf3 l.jpg
Why 4NF?

  • To eliminate the possibility for data anomalies.


Why 4nf4 l.jpg
Why 4NF?

  • To reduce the need for:

    • inserts,

    • updates

    • deletes



Non trival multi valued dependencies mvd l.jpg
Non-Trival Multi-Valued Dependencies (MVD)

  • Assume X is the Superkey

    • “Superkey” still depends on FD’s only.

  • Y is not a subset of X

  • X and Y are not, together, all the attributes.


Recap of 4nf definition l.jpg
Recap of 4NF Definition

  • No non-trivial multi-valued dependencies

    - Except on superset of a candidate key

    - Multi-valued dependencies are functional dependencies.

  • Table must be in BCNF


Recap of 4nf definition8 l.jpg
Recap of 4NF Definition

  • No Duplications

  • Table must be in BCNF


Example to get 4nf l.jpg
Example to get 4NF

  • Assume the table is in BCNF

  • The town, Region, and District together form the candidate key.

From Reference #1


Example to get 4nf10 l.jpg
Example to get 4NF

  • Decomposed into two tables

From Reference #1


Example 2 is it in 3nf or bcnf l.jpg
Example 2: Is it in 3NF or BCNF?

Pizza Delivery

From Reference #2


Example 2 is it in 3nf or bcnf12 l.jpg
Example 2: Is it in 3NF or BCNF?

  • The table has no non-key attributes because its only key is {Restaurant, Pizza Variety, Delivery Area}.

  • The answer is BCNF.

From Reference #2


Example 2 is it in 4nf l.jpg
Example 2: Is it in 4NF?

Pizza Delivery

From Reference #2


Example 2 is it in 4nf14 l.jpg
Example 2: Is it in 4NF?

  • If we assume, that pizza varieties offered by a restaurant are not affected by delivery area, then it does not meet 4NF.

  • The answer is NO.

From Reference #2


Why not in 4nf l.jpg
Why not in 4NF?

Two Non-trivial: MVD

Pizza Delivery

From Reference #2


Why not in 4nf16 l.jpg
Why not in 4NF?

  • The table has two non-trivial multivalued dependencies on the {Restaurant} attribute (which is not a superkey).

  • The dependencies are:

    • {Restaurant} →→ {Pizza Variety}

    • {Restaurant} →→ {Delivery Area}

From Reference #2


How to fix it 4nf l.jpg
How to “fix it” (4NF)?

Two Non-trivial: MVD

Pizza Delivery

From Reference #2


How to fix it 4nf18 l.jpg
How to “fix it” (4NF)?

Varieties By Restaurant

Delivery Areas By Restaurant

No Duplications among rows! Yay!

From Reference #2


Practice example l.jpg
Practice Example

  • Is this 3NF or BCNF?

  • Is this 4NF?

  • If not, what are the decomposed tables in 4NF?

Pizza Delivery


Practice example answer l.jpg
Practice Example (Answer)

  • BCNF 2. NO 3. See Below

Delivery Areas By Restaurant

Varieties By Restaurant

No Duplications among rows! Yay!


References l.jpg
References

  • Website: Database Design: 4th and 5th Normal Forms « Tod means Fox

    URL:http://blog.todmeansfox.com/2007/12/04/database-design-4th-and-5th-normal-forms/

    2. Website: Fourth normal form - Wikipedia, the free encyclopedia

    URL: http://en.wikipedia.org/wiki/Fourth_normal_form


ad