Chapter 8 Normalization. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
1 Week 4: Normalisation: Redundant data becomes inconsistent data; therefore … “The key, the whole key, and nothing but the key,so help me, Codd”
Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Normalization of Database Tables
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Developing Data Models for Business Databases.
Normalization of Database Tables
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 7 Normalization of Relational Tables.
Normalization of Database Tables
Normalization of Database Tables
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
7-1 Normalization - Outline  Modification anomalies  Functional dependencies  Major normal forms  Practical concerns.
Chapter 5 Normalization of Database Tables
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Chapter 6 Developing Data Models for Business Databases.
NORMALIZATION N. HARIKA (CSC).
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 3 The Relational Data Model.
Normalization Quiz Tao Li Grant Horntvedt. 1. Which of the following statements is true: a. Normal forms can be derived by inspecting the data in various.
Chapter 3 The Relational Model and Normalization
7 Copyright © 2006, Oracle. All rights reserved. Normalization of Relational Tables (Part I)
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Lecture 12 Inst: Haya Sammaneh
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Chapter 5: Logical Database Design and the Relational Model
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 The Relational Model and Normalization.
Concepts of Database Management, Fifth Edition
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
Chapter 7 Normalization. Outline Modification anomalies Functional dependencies Major normal forms Relationship independence Practical concerns.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Chapter 7 Normalization. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Modification anomalies Functional dependencies.
Chapter 2 The Relational Data Model. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Relational model basics Integrity.
Chapter 10 Application Development with Views. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Background Creating.
Database Design, Application Development, and Administration, 5 th Edition Copyright © 2011 by Michael V. Mannino All rights reserved. Chapter 6 Developing.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
Chapter 9 Advanced Query Formulation with SQL. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Outer join problems.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Lecture No 14 Functional Dependencies & Normalization ( III ) Mar 04 th 2011 Database Systems.
Database Design – Lecture 8
Normalization of Database Tables
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 10 Application Development with Views.
Database Systems, 8 th Edition Improving the Design Table structures cleaned up to eliminate initial partial and transitive dependencies Normalization.
Ch 7: Normalization-Part 1
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
7 Copyright © 2006, Oracle. All rights reserved. Normalization of Relational Tables (Part II)
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.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
Chapter 2 The Relational Data Model. Outline Relational model basics Integrity rules Rules about referenced rows Relational Algebra.
A brief summary of database normalization
Relational Model and ER Model: in a Nutshell
Chapter 6 Normalization of Database Tables
* 07/16/96 Normalization 2/16/2019 *.
Presentation transcript:

Chapter 8 Normalization

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies Major normal forms Relationship independence Practical concerns

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Modification Anomalies Unexpected side effect Insert, modify, and delete more data than desired Caused by excessive redundancies Strive for one fact in one place

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Big University Database Table

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Functional Dependencies Constraint on the possible rows in a table Value neutral like FKs and PKs Asserted Understand business rules

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin FD Definition X  Y X (functionally) determines Y X: left-hand-side (LHS) or determinant For each X value, there is at most one Y value Similar to candidate keys

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin FD Diagrams and Lists StdSSN  StdCity, StdClass OfferNo  OffTerm, OffYear, CourseNo, CrsDesc CourseNo  CrsDesc StdSSN, OfferNo  EnrGrade

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin FDs in Data Prove non-existence (but not existence) by looking at data Two rows that have the same X value but a different Y value

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Normalization Process of removing unwanted redundancies Apply normal forms –Identify FDs –Determine whether FDs meet normal form –Split the table to meet the normal form if there is a violation

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Relationships of Normal Forms

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin 1NF Starting point for SQL2 databases No repeating groups: flat rows

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Combined Definition of 2NF/3NF Key column: candidate key or part of candidate key Analogy to the traditional justice oath Every nonkey depends on a key, the whole key, and nothing but the key Usually taught as separate definitions

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin 2NF Every nonkey column depends on a whole key, not part of a key Violations –Part of key  nonkey –Violations only for combined keys

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin 2NF Example Many violations for the big university database table –StdSSN  StdCity, StdClass –OfferNo  OffTerm, OffYear, CourseNo, CrsDesc Splitting the table –UnivTable1 (StdSSN, StdCity, StdClass) –UnivTable2 (OfferNo, OffTerm, OffYear, CourseNo, CrsDesc)

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin 3NF Every nonkey column depends only on a key not on nonkey columns Violations: Nonkey  Nonkey Alternative formulation –No transitive FDs –A  B, B  C then A  C –OfferNo  CourseNo, CourseNo  CrsDesc then OfferNo  CrsDesc

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin 3NF Example One violation in UnivTable2 –CourseNo  CrsDesc Splitting the table –UnivTable2-1 (OfferNo, OffTerm, OffYear, CourseNo, CrsDesc) –UnivTable2-2 (CourseNo, CrsDesc)

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin BCNF Every determinant must be a candidate key Simpler definition Apply with simple synthesis procedure Special case not covered by 3NF –Part of key  Part of key –Special case is not common

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin BCNF Example Many violations for the big university database table –StdSSN  StdCity, StdClass –OfferNo  OffTerm, OffYear, CourseNo, CrsDesc –CourseNo  CrsDesc Splitting into four tables

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Simple Synthesis Procedure 1.Eliminate extraneous columns from the LHSs. 2.Remove derived FDs. 3.Arrange the FDs into groups with each group having the same determinant. 4.For each FD group, make a table with the determinant as the primary key. 5.Merge tables in which one table contains all columns of the other table.

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Simple Synthesis Example Step 1: no extraneous columns Step 2: eliminate OfferNo  CrsDesc Step 3: already arranged by LHS Step 4: four tables (Student, Enrollment, Course, Offering) Step 5: no redundant tables

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Relationship Independence and 4NF M-way relationship that can be derived from binary relationships Split into binary relationships Specialized problem 4NF does not involve FDs

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Relationship Independence Problem

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Relationship Independence Solution

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin MVDs and 4NF MVD: difficult to identify –A  B | C (multi-determines) –A associated with a collection of B and C values –B and C are independent –Nontrivial MVD: not also an FD 4NF: no nontrivial MVDs

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Higher Level Normal Forms 5NF for M-way relationships DKNF: absolute normal form DKNF is an ideal, not a practical normal form

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Role of Normalization Refinement –Use after ERD –Apply to table design or ERD Initial design –Record attributes and FDs –No initial ERD –May reverse engineer an ERD

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Normalization Objective Update biased Not a concern for databases without updates (data warehouses) Denormalization –Purposeful violation of a normal form –Some FDs may not cause anomalies –May improve performance

© 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Summary Beware of unwanted redundancies FDs are important constraints Strive for BCNF Use a CASE tool for large problems Important tool of database development Focus on the normalization objective