Unit 4: Normalization of Relations

Slides:



Advertisements
Similar presentations
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Advertisements

1 Logical Database Design and the Relational Model Modern Database Management.
CSc-340 6b1 Relational Database Design Chapter 8 [1 of 2] Features of Good Relational Designs Atomic Domains and First Normal Form Decomposition Using.
Systems Development Life Cycle
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
The Database Approach u Emphasizes the integration of data across the organization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 4: Logical Database Design and the Relational Model
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Getting Started Chapter One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 5: Logical Database Design and the Relational Model
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
TM 6-1 Copyright © Addison Wesley Longman, Inc. & Dr. Chen, Business Database Systems Logical Database Design and the Relational Database Professor Chen.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 4: Logical Database Design and the Relational Model Modern Database Management 10.
Chapter 4: Logical Database Design and the Relational Model (Part II)
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: The Enhanced E-R Model Modern Database Management 10 th Edition Jeffrey A. Hoffer,
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Chapter 5: Logical Database Design and the Relational Model
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 1 Workshop 2 Tables, Keys, and Relationships Series Editor Amy Kinser.
Chapter 5 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
© 2005 by Prentice Hall 1 The Database Development Process Dr. Emad M. Alsukhni The Database Development Process Dr. Emad M. Alsukhni Modern Database Management.
Pree Thiengburanathum, CAMT, Chiang Mai University 1 Database System Logical Database Design and the Relational Model November 1 st, 2009 Software Park,
Logical Database Design and the Relational Model.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part c): Logical Database Design and the Relational Model Modern Database Management.
© 2012 Pearson Education, Inc. publishing Prentice Hall. Note 9 The Product Life Cycle.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Normalization Hour1,2 Presented & Modified by Mahmoud Rafeek Alfarra.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 3: LOGICAL DATABASE.
Chapter 5 MODULE 6: Normalization © 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Prepared by: KIM GASTHIN M. CALIMQUIM.
© 2007 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 4, Part A: Logical Database Design and the Relational Model
Lecture 4: Logical Database Design and the Relational Model 1.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Chapter 4 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 4: Logical Database Design and the Relational Model Modern Database Management.
Lecture # 17 Chapter # 10 Normalization Database Systems.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 4: PART C LOGICAL.
N ORMALIZATION 1. Chapter 5 R ELATION Definition: A relation is a named, two-dimensional table of data Table consists of rows (records) and columns (attribute.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 8: Object-Relational Modeling
Chapter 4 Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Normalization Karolina muszyńska
Modern Database Management Jeff Hoffer, Ramesh Venkataraman,
Chapter 5: Logical Database Design and the Relational Model
MIS 322 – Enterprise Business Process Analysis
Chapter 4: Logical Database Design and the Relational Model
Chapter 4 Relational Databases
Example Question–Is this relation Well Structured? Student
Chapter 9 Designing Databases
Relational Database.
Chapter 9 Designing Databases
Chapter 5: Logical Database Design and the Relational Model
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
CHAPTER 1: THE DATABASE ENVIRONMENT AND DEVELOPMENT PROCESS
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
Getting Started Chapter One DATABASE CONCEPTS, 5th Edition
Getting Started Chapter One DATABASE CONCEPTS, 4th Edition
Presentation transcript:

Unit 4: Normalization of Relations Modern Database Management 9th Edition Jeffrey A. Hoffer, Mary B. Prescott, Heikki Topi © 2009 Pearson Education, Inc.  Publishing as Prentice Hall

Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of data The process of decomposing relations with anomalies to produce smaller, well-structured relations

Well-Structured Relations A relation that contains minimal data redundancy and allows users to insert, delete, and update rows without causing data inconsistencies Goal is to avoid anomalies Insertion Anomaly–adding new rows forces user to create duplicate data Deletion Anomaly–deleting rows may cause a loss of data that would be needed for other future rows Modification Anomaly–changing data in a row forces changes to other rows because of duplication General rule of thumb: A table should not pertain to more than one entity type

Example–Figure 5-2b Question–Is this a relation? Answer–Yes: Unique rows and no multivalued attributes Question–What’s the primary key? Answer–Composite: Emp_ID, Course_Title

Anomalies in this Table Insertion–can’t enter a new employee without having the employee take a class Deletion–if we remove employee 140, we lose information about the existence of a Tax Acc class Modification–giving a salary increase to employee 100 forces us to update multiple records Why do these anomalies exist? Because there are two themes (entity types) in this one relation. This results in data duplication and an unnecessary dependency between the entities

Functional Dependencies and Keys Functional Dependency: The value of one attribute (the determinant) determines the value of another attribute Candidate Key: A unique identifier. One of the candidate keys will become the primary key E.g. perhaps there is both credit card number and SS# in a table…in this case both are candidate keys Each non-key field is functionally dependent on every candidate key

Figure 5.22 Steps in normalization

First Normal Form No multivalued attributes Every attribute value is atomic Fig. 5-25 is not in 1st Normal Form (multivalued attributes)  it is not a relation Fig. 5-26 is in 1st Normal form All relations are in 1st Normal Form

Table with multivalued attributes, not in 1st normal form Note: this is NOT a relation

Table with no multivalued attributes and unique rows, in 1st normal form Note: this is a relation, but not a well-structured one

Anomalies in this Table Insertion–if new product is ordered for order 1007 of existing customer, customer data must be re-entered, causing duplication Deletion–if we delete the Dining Table from Order 1006, we lose information concerning this item's finish and price Update–changing the price of product ID 4 requires update in several records Why do these anomalies exist? Because there are multiple themes (entity types) in one relation. This results in duplication and an unnecessary dependency between the entities

Second Normal Form 1NF PLUS every non-key attribute is fully functionally dependent on the ENTIRE primary key Every non-key attribute must be defined by the entire key, not by only part of the key No partial functional dependencies

Therefore, NOT in 2nd Normal Form Figure 5-27 Functional dependency diagram for INVOICE Order_ID  Order_Date, Customer_ID, Customer_Name, Customer_Address Customer_ID  Customer_Name, Customer_Address Product_ID  Product_Description, Product_Finish, Unit_Price Order_ID, Product_ID  Order_Quantity Therefore, NOT in 2nd Normal Form

Figure 5-28 Removing partial dependencies Getting it into Second Normal Form Partial dependencies are removed, but there are still transitive dependencies

Third Normal Form 2NF PLUS no transitive dependencies (functional dependencies on non-primary-key attributes) Note: This is called transitive, because the primary key is a determinant for another attribute, which in turn is a determinant for a third Solution: Non-key determinant with transitive dependencies go into a new table; non-key determinant becomes primary key in the new table and stays as foreign key in the old table

Transitive dependencies are removed Figure 5-29 Removing partial dependencies Getting it into Third Normal Form Transitive dependencies are removed

Merging Relations View Integration–Combining entities from multiple ER models into common relations Issues to watch out for when merging entities from different ER models: Synonyms–two or more attributes with different names but same meaning Homonyms–attributes with same name but different meanings Transitive dependencies–even if relations are in 3NF prior to merging, they may not be after merging Supertype/subtype relationships–may be hidden prior to merging

Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Copyright © 2009 Pearson Education, Inc.  Publishing as Prentice Hall 18