7-1 Normalization - Outline  Modification anomalies  Functional dependencies  Major normal forms  Practical concerns.

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”
N ORMALIZATION Joe Meehean 1. R EDUNDANCIES Repeated data in database Wastes space Can cause modification anomalies unexpected side effect when changing.
Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
NORMALIZATION FIRST NORMAL FORM (1NF): A relation R is in 1NF if all attributes have atomic value = one value for an attribute = no repeating groups =
Chapter 8 Normalization. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies.
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.
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.
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.
NORMALIZATION N. HARIKA (CSC).
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
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)
Normalization B Database Systems Normal Forms Wilhelm Steinbuss Room G1.25, ext. 4041
Chapter 5 Normalization of Database Tables
Lecture 12 Inst: Haya Sammaneh
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
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 Sixth Edition Chapter 5 Database Design 1: Normalization.
Concepts of Database Management, Fifth Edition
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
The Relational Model and Normalization R. Nakatsu.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
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.
9 Advanced Query Formulation with SQL (Chapter 9).
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.
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
Normalization of Database Tables
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
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,
Concepts of Database Management Seventh Edition Chapter 5 Database Design 1: 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.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
Copyright © Curt Hill Schema Refinement II 2 nd NF to 3 rd NF to BCNF.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Logical Database Design and Relational Data Model Muhammad Nasir
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
Chapter 6 Normalization of Database Tables
* 07/16/96 Normalization 2/16/2019 *.
Database.
Presentation transcript:

7-1 Normalization - Outline  Modification anomalies  Functional dependencies  Major normal forms  Practical concerns

7-2 Outline  Modification anomalies  Functional dependencies  Major normal forms  Relationship independence  Practical concerns

7-3 Modification Anomalies  Unexpected side effect  Insert, modify, and delete more data than desired  Caused by excessive redundancies  Strive for one fact in one place

7-4 Big University Database Table

7-5 Modification Anomaly Examples  Insertion  Insert more column data than desired  Must know student number and offering number to insert a new course  Update  Change multiple rows to change one fact  Must change two rows to change student class of student S1  Deletion  Deleting a row causes other facts to disappear  Deleting enrollment of student S2 in offering O3 causes loss of information about offering O3 and course C3

7-6 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

7-7 FD Diagrams and Lists StdSSN  StdCity, StdClass OfferNo  OffTerm, OffYear, CourseNo, CrsDesc CourseNo  CrsDesc StdSSN, OfferNo  EnrGrade

7-8 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

7-9 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

7-10 Relationships of Normal Forms

7-11 1NF  Starting point for most relational DBMSs  No repeating groups: flat rows

7-12 Combined Definition of 2NF/3NF  Key column: candidate key or part of candidate key  Every non key column depends on all candidate keys, whole candidate keys, and nothing but candidate keys  Usually taught as separate definitions

7-13 2NF  Every nonkey column depends on all candidate keys, not a subset of any candidate key  Violations  Part of key  nonkey  Violations only for combined keys

7-14 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)

7-15 3NF  Every nonkey column depends only on candidate keys, not on non key columns  Violations: Nonkey  Nonkey  Alterative formulation  No transitive FDs  A  B, B  C then A  C  OfferNo  CourseNo, CourseNo  CrsDesc then OfferNo  CrsDesc

7-16 3NF Example  One violation in UnivTable2  CourseNo  CrsDesc  Splitting the table  UnivTable2-1 (OfferNo, OffTerm, OffYear, CourseNo)  UnivTable2-2 (CourseNo, CrsDesc)

7-17 BCNF  Every determinant must be a candidate key.  Simpler definition  Apply with simple synthesis procedure  Special cases not covered by 3NF  Part of key  Part of key  Nonkey  Part of key  Special cases are not common

7-18 BCNF Example  Primary key: (OfferNo, StdSSN)  Many violations for the big university database table  StdSSN  StdCity, StdClass  OfferNo  OffTerm, OffYear, CourseNo  CourseNo  CrsDesc  Split into four tables

7-19 Multiple Candidate Keys  Multiple candidate keys do not violate either 3NF or BCNF  You should not split a table just because it contains multiple candidate keys.  Splitting a table unnecessarily can slow query performance.

7-20 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  Non trivial MVD: not also an FD  4NF: no non trivial MVDs

7-21 MVD Representation A  B | C OfferNo  StdSSN | TextNo Given the two rows above the line, the two rows below the line are in the table if the MVD is true.

7-22 Higher Level Normal Forms  5NF for M-way relationships  DKNF: absolute normal form  DKNF is an ideal, not a practical normal form

7-23 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 after normalization

7-24 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

7-25 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