DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
More about Functional Dependencies and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 9.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day5.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 4 Database Design Using.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 COS 346 Day6.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 1-1 COS 346 Day 3.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke Database Processing Chapter 3 Normalization.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Chapter 5 Normalization of Database Tables
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
Chapter 3 The Relational Model and Normalization
SQL Normalization Database Design Lecture 5. Copyright 2006Page 2 SQL Normalization Database Design 1 st Normal Form 1 st Normal Form 2 nd Normal Form.
Database Design Chapter Five DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall 5-1 Chapter Objectives Learn how to transform E-R data models into relational.
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
(C) 2000, The University of Michigan 1 Database Application Design Handout #4 January 28, 2000.
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
IT420: Database Management and Organization Normalization 31 January 2006 Adina Crăiniceanu
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
© 2002 by Prentice Hall 1 Database Design David M. Kroenke Database Concepts 1e Chapter 5 5.
Database Systems: Design, Implementation, and Management Tenth Edition
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Chapter 4 The Relational Model and Normalization.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
The Relational Model and Normalization R. Nakatsu.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
The Relational Model and Normalization The Relational Model Normalization First Through Fifth Normal Forms Domain/Key Normal Form The Synthesis of Relations.
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 4-1 David M. Kroenke’s Chapter Four: Database.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Gegevens Analyse Les 3: Normaliseren. Chapter Premise We have received one or more tables of existing data The data is to be stored in a new database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 What Makes Determinant Values Unique? A determinant is unique in.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Four: Database Design Using Normalization 4-1 KROENKE.
Gegevens Analyse Les 4: Normaliseren. Functional Dependency Rules If A  (B, C), then A  B and A  C If (A,B)  C, then neither A nor B determines C.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Four: Database Design Using Normalization.
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
5. The Relational Model and Normalization 5.1 Relational Model5.2 Normalization 5.3 1NF to 5NF 5.4 Domain/Key Normalization 5.5 Synthesis of Relation 5.6.
Normal Forms 1NF – A table that qualifies as a relation is in 1NF. (Back)(Back) 2NF – A relation is in 2NF if all of its nonkey attributes are dependent.
Adapted from DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 Functional Dependencies and Normalization.
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
Database Processing: David M. Kroenke’s Chapter Four:
Database Design Using Normalization
The Relational Model and Normalization
The Relational Model and Normalization
Database Processing: David M. Kroenke’s Chapter Three:
David M. Kroenke and David J
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
Chapter 4 The Relational Model and Normalization
Presentation transcript:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-2 Agenda Questions? Assignment 1 Is Corrected –2 A’s, 3 B’s, 1 C and 1 D –Pay attention to details! Problems with reports and forms MultiTable Examples in Appendix A Assignment Two is posted –Marcia’s Dry Cleaning Project on page 97 & 98, question A through F –Due Feb 5 at 3:35 PM (next Class) Discussion on The Relational Model and Normalization –More in class work

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-3 Modification Anomalies Deletion Anomaly Insertion Anomaly Update Anomaly

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-4 Deletion Anomalies Deleting facts about one entity causes the deletion of facts about another entity

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-5 Insertion Anomalies We cannot store facts about entity until we have another entity of different type to store –Add scuba to following

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-6 Modification Anomalies The EQUIPMENT_REPAIR table before and after an incorrect update operation on AcquisitionCost for Type = Drill Press:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-7 Fixing Anomalies Split the relation

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-8 Normalization Normalization eliminates modification anomalies –Deletion anomaly: deletion of a row loses information about two or more entities –Insertion anomaly: insertion of a fact in one entity cannot be done until a fact about another entity is added Anomalies can be removed by splitting the relation into two or more relations; each with a different, single theme However, breaking up a relation may create referential integrity constraints Normalization works through classes of relations called normal forms

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-9 Relationship of Normal Forms

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-10 Normal Forms Relations are categorized as a normal form based on which modification anomalies or other problems that they are subject to:

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-11 Normal Forms 1NF – A table that qualifies as a relation is in 1NF 2NF – A relation is in 2NF if all of its nonkey attributes are dependent on all of the primary key 3NF – A relation is in 3NF if it is in 2NF and has no determinants except the primary key Boyce-Codd Normal Form (BCNF) – A relation is in BCNF if every determinant is a candidate key “I swear to construct my tables so that all nonkey columns are dependent on the key, the whole key and nothing but the key, so help me Codd.”

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-12 Normal Forms (Part 2) Any table of data is in 1NF if it meets the definition of a relation A relation is in 2NF if all its non-key attributes are dependent on all of the key (no partial dependencies) –If a relation has a single attribute key, it is automatically in 2NF A relation is in 3NF if it is in 2NF and has no transitive dependencies A relation is in BCNF if every determinant is a candidate key A relation is in fourth normal form if it is in BCNF and has no multi-value dependencies Fifth Normal form is too theoretical to bother with To be in Domain/Key Normal Form (DK/NF) every constraint on the relation must be a logical consequence of the definition of keys and domains.

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-13 Eliminating Modification Anomalies from Functional Dependencies in Relations Put all relations into Boyce-Codd Normal Form (BCNF):

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-14 Putting a Relation into BCNF: EQUIPMENT_REPAIR

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-15 Putting a Relation into BCNF: EQUIPMENT_REPAIR EQUIPMENT_REPAIR (ItemNumber, Type, AcquisitionCost, RepairNumber, RepairDate, RepairAmount) ItemNumber  (Type, AcquisitionCost) RepairNumber  (ItemNumber, Type, AcquisitionCost, RepairDate, RepairAmount) ITEM (ItemNumber, Type, AcquisitionCost) REPAIR (ItemNumber, RepairNumber, RepairDate, RepairAmount) Where REPAIR.ItemNumber must exist in ITEM.ItemNumber

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-16 Putting a Relation into BCNF: New Relations

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-17 Putting a Relation into BCNF: SKU_DATA

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-18 Putting a Relation into BCNF: SKU_DATA SKU_DATA (SKU, SKU_Description, Department, Buyer) SKU  (SKU_Description, Department, Buyer) SKU_Description  (SKU, Department, Buyer) Buyer  Department SKU_DATA (SKU, SKU_Description, Buyer) BUYER (Buyer, Department) Where BUYER.Buyer must exist in SKU_DATA.Buyer

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-19 Putting a Relation into BCNF: New Relations

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-20 Multivalued Dependencies A multivalued dependency occurs when a determinant determines a particular set of values: Employee  Degree Employee  Sibling PartKit  Part The determinant of a multivalued dependency can never be a primary key

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-21 Multivalued Dependencies

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-22 Eliminating Anomalies from Multivalued Dependencies Multivalued dependencies are not a problem if they are in a separate relation, so: –Always put multivalued dependencies into their own relation –This is known as Fourth Normal Form (4NF)

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-23 Fixing 4thNF (Generally Speaking) A relation R(A,B,C) –A->->B –A->->C –B and C are independent Create R(A,B) andR1(A,C)

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-24 Fifth Normal Form (5NF) The Fifth Normal Form concerns dependencies that are obscure and beyond the scope of this text. Punt!

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-25 Domain/Key Normal Form (DK/NF) To be in Domain/Key Normal Form (DK/NF) every constraint on the relation must be a logical consequence of the definition of keys and domains. Ultimate Normal Form –1981 Fagin NO possible anomalies

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-26 DK/NF Terminology Constraint –A rule governing static values of attributes Key –A unique identifier of a tuple Domain –A description of an attribute’s allowable values

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-27 De-normalized Designs When a normalized design is unnatural, awkward, or results in unacceptable performance, a de-normalized design is preferred Example –Normalized relation CUSTOMER (CustNumber, CustName, Zip) CODES (Zip, City, State) –De-Normalized relations CUSTOMER (CustNumber, CustName, City, State, Zip)

DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-28 David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10 th Edition) End of Presentation: Chapter Three