1 / 26

Chapter 5

Chapter 5. Database Design 1: Normalization. Objectives. Discuss functional dependence Define first normal form, second normal form, and third normal form

tal
Download Presentation

Chapter 5

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 5 Database Design 1: Normalization Concepts of Database Management, 4th Edition, Pratt & Adamski

  2. Objectives • Discuss functional dependence • Define first normal form, second normal form, and third normal form • Describe the problems associated with tables (relations) that are not in first normal form, second normal form, or third normal form along with the mechanism for converting to all three Concepts of Database Management, 4th Edition, Pratt & Adamski

  3. Objectives • Discuss the problems associated with incorrect conversions to third normal form • Define fourth normal form • Describe the problems associated with tables (relations) that are not in fourth normal form and describe the mechanism for converting to fourth normal form Concepts of Database Management, 4th Edition, Pratt & Adamski

  4. Functional Dependence • Column B is functionally dependent on Column A if A’s value determines a single value for B at a given time • Given A, a single value for B can be determined Concepts of Database Management, 4th Edition, Pratt & Adamski

  5. Functional Dependence Example Figures 5.3 - 5.4 Rep Table Where LastName can determine record Rep Table Where LastName cannot determine record Concepts of Database Management, 4th Edition, Pratt & Adamski

  6. Keys • Column(s) C is primary key for table T if: Property 1: All columns in T are functionally dependent on C Property 2: No subcollection of columns in C (assuming C is a collection of columns and not just a single column) also has Property 1 • Candidate Keys • Column(s) on which all other columns in table are functionally dependent • Alternate Keys • Candidate keys not chosen as primary keys Concepts of Database Management, 4th Edition, Pratt & Adamski

  7. First Normal Form (1NF) • Unnormalized table • Contains a repeating group • Table in 1NF • Contains no repeating groups • Removal of repeating groups is starting point in quest for problem-free tables Concepts of Database Management, 4th Edition, Pratt & Adamski

  8. 1NF Example Figure 5.5 Unnormalized Table Concepts of Database Management, 4th Edition, Pratt & Adamski

  9. 1NF Example (con’t.) Figure 5.6 Conversion to 1NF Concepts of Database Management, 4th Edition, Pratt & Adamski

  10. Second Normal Form (2NF) • 1NF Tables may contain problems • Redundancy • Update Anomalies • Update, inconsistent data, additions, deletions • Occur because a column is dependent on a portion of a multi-column primary key • 2NF Table • In 1NF and no nonkey column is dependent on only a portion of the primary key Concepts of Database Management, 4th Edition, Pratt & Adamski

  11. Dependency Diagram for Orders Figure 5.8 Concepts of Database Management, 4th Edition, Pratt & Adamski

  12. 2NF Example Figure 5.9a Concepts of Database Management, 4th Edition, Pratt & Adamski

  13. 2NF Example Figure 5.9b Concepts of Database Management, 4th Edition, Pratt & Adamski

  14. Third Normal Form (3NF) • 2NF Tables may still contain problems • Redundancy and wasted space • Update Anomalies • Update, inconsistent data, additions, deletions • Occur because a column is dependent on a portion of a multi-column primary key • 3NF Table • In 2NF and the only determinants contained are candidate keys Concepts of Database Management, 4th Edition, Pratt & Adamski

  15. Customers Dependency Diagram Figure 5.11 Concepts of Database Management, 4th Edition, Pratt & Adamski

  16. 3NF Example Figure 5.12a Concepts of Database Management, 4th Edition, Pratt & Adamski

  17. 3NF Example Figure 5.12b Concepts of Database Management, 4th Edition, Pratt & Adamski

  18. Incorrect Decomposition Example Figure 5.13a Concepts of Database Management, 4th Edition, Pratt & Adamski

  19. Incorrect Decomposition Example Figure 5.13b Concepts of Database Management, 4th Edition, Pratt & Adamski

  20. 2nd Incorrect Decomposition Figure 5.14a Concepts of Database Management, 4th Edition, Pratt & Adamski

  21. 2nd Incorrect Decomposition Figure 5.14b Concepts of Database Management, 4th Edition, Pratt & Adamski

  22. Fourth Normal Form (4NF) • 3NF Tables may still contain problems • Dependencies • Update Anomalies • Update, additions, deletions • Occur because of multivalued dependencies • 4NF Table • In 3NF and has no multivalued dependencies Concepts of Database Management, 4th Edition, Pratt & Adamski

  23. Incorrect 4NF Example Figure 5.15 Concepts of Database Management, 4th Edition, Pratt & Adamski

  24. 4NF Example Figure 5.16a Concepts of Database Management, 4th Edition, Pratt & Adamski

  25. 4NF Example Figure 5.16b Concepts of Database Management, 4th Edition, Pratt & Adamski

  26. Normal Forms Figure 5.17 Concepts of Database Management, 4th Edition, Pratt & Adamski

More Related