R. J. Daigle Normalization Concepts CIS 507 Database Programming.

Slides:



Advertisements
Similar presentations
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Advertisements

Chapter 5 Normalization of Database Tables
© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
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.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Normalization of Database Tables
Normalization I.
© 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.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
NORMALIZATION N. HARIKA (CSC).
Chapter 3 The Relational Model and Normalization
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Week 6 Lecture Normalization
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
Lecture 12 Inst: Haya Sammaneh
Copyright, Harris Corporation & Ophir Frieder, Normal Forms “Why be normal?” - Author unknown Normal.
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.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
Bordoloi Database Design: Normalization Dr. Bijoy Bordoloi.
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.
Concepts of Database Management, Fifth Edition
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.
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.
Module III: The Normal Forms. Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form. The database.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
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.
By Abdul Rashid Ahmad. E.F. Codd proposed three normal forms: The first, second, and third normal forms 1NF, 2NF and 3NF are based on the functional dependencies.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Normalization of Database Tables
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Data Analysis Improving Database Design. Normalization The process of transforming a data model into a flexible, stable structure. Reduces anomalies Anomaly.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
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,
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
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.
Southern Methodist University CSE CSE 2337 Introduction to Data Management Chapter 5 Part II.
Normalization ACSC 425 Database Management Systems.
Normal Forms (Part 1) Steven Le ~ CS157B. Normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying.
Logical Database Design and Relational Data Model Muhammad Nasir
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
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.
Normalization.
Database Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
The Relational Model and Normalization
Chapter 6 Normalization of Database Tables
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Presentation transcript:

R. J. Daigle Normalization Concepts CIS 507 Database Programming

R. J. Daigle Two types of Anomalies associated with databases. Modification Anomaly –an unexpected consequence of changing the actual data in a database Design Anomaly –a flaw in the logical design of the database itself Basic Principles: –For each modification anomaly there is a design anomaly –For each design anomaly there are associated modification anomalies Introduction EmployeeIDLast NameFirst Name JonesSamual SmithSandra EdwardsEdwin EmployeeID

R. J. Daigle Types of modification anomalies: Insertion: –add a new student—since the key is STUDENT-ID + COURSE, a student can only be added when the course has been completed. Deletion: –of student results in the loss of information about course CIS 503. Update. –Student to Tonya Marshall requires the change to take place in several places. STUDENT-IDSTUDENT-NAMECOURSECOURSE NAMEGRADE John SmithCIS 501Accelerated ProgrammingB Tonya TuckerCIS 501Accelerated ProgrammingB Tonya TuckerCIS 502Architecture and OSA Michael BoydCIS 503Data and File StructureA George JonesCIS 502Architecture and OSB Tonya TuckerCIS 504Networks & CommunicationsC

R. J. Daigle Normalization Design anomalies have been classified and criteria for removal of the anomalies have been developed. The process of removing design anomalies is called Normalization. A Normal Form is associated with the removal of a specific type of anomaly. The known normal forms from lowest to highest are: 1NF, 2NF, 3NF, BCNF, 4NF, 5NF, DKNF Any design which is evaluated as a higher form automatically satisfies the lower forms.

R. J. Daigle Normalization Theory of Normalization Contributors –Dr. E. F. Codd introduced the first three normal forms in the same paper in which the Relational Model was introduced ( A Relational Model of Data for Large Shared Databanks, CACM, Vol 13, No 6, June, 1970.) –Dr. R. F. Boyce extended Codd's original three forms. –Dr. R. Fagin extended the theory as proposed by Codd and introduced another way of evaluating a design. –Dr. D. M. Kroenke has been instrumental in clarifying the theory of normal forms in his role as educator.

R. J. Daigle Known Normal Forms. The normal forms in order from lowest to highest are –First Normal Form (1NF). Elimination of repeating field types –Second Normal Form (2NF). Elimination of partial key dependencies. –Third Normal Form (3NF). Elimination of transitive key dependencies among non-key attributes. –Boyce-Codd Normal Form (BCNF). Elimination of partial key dependencies upon non-key attributes. –Fourth Normal Form (4NF). Elimination of multi-valued dependencies. –Fifth Normal Form (5NF). Elimination of join anomalies. –Domain Key Normal Form. Elimination of all modification anomalies.

R. J. Daigle Basic Definitions. Assumptions: –e is an entity type –ε is the set of attributes for e –A, B, C,... are non-empty subsets of ε

R. J. Daigle Basic Definitions. Functional Dependence: B is Functionally Dependent on A if for each value of A there is exactly one value of B. –A is said to Functionally Determine B –A is called a Determinant. –The relationship between A and B is represented as A --> B –If A --> ε, A is said to be an Identifier for the entity type e Example e = STUDENT-DORM-FEE ε = {STUD-ID, STUD-NAME, DORM, DORM-FEE} A = {STUD-ID} B = {DORM} C = {DORM-FEE} A --> ε, B --> C

R. J. Daigle Key K is a Key for the entity e if and only if 1.K --> ε and 2.no non-empty subset of K determines ε. Example (From last example) –A = {STUD-ID} is a key for e = STUDENT-DORM- FEE –{STUD-ID, DORM-FEE} is not a key for e. An attribute which belongs to the selected key A is called a Key Attribute; all other attributes are called Non-Key Attributes.

R. J. Daigle First Normal Form (1NF) (Repeating Attribute Types) A is a repeating attribute type or repeating field type if for each occurrence of e there may be 0, 1, or more occurrences of values for A. The data structure used for a repeating attribute types gives rise to maintenance difficulties. –Static approach: embedding repeating field type is within the entity type (implemented as an array) allocation for maximal perceived use results in unused space or insufficient storage for some entities if the maximal perceived use is underestimated –Dynamic approach: data structure which requires more complex functions for management. Example. –e = {STUD-ID, STUD-NAME, COURSE, COURSE-GRADE} COURSE and COURSE-GRADE form a repeating type pair of attributes since any student will have completed 0, 1, or more courses.

R. J. Daigle First Normal Form (1NF) (Atomic Attributes) An attribute is Atomic if the attribute defines the lowest level of usage of data collected for the attribute. Example. e = {STUD-ID, STUD-NAME, COURSE, COURSE-GRADE} –No guarantee that LAST-NAME will available since the design does not define it as an attribute. –Examples for Johnson Albert Gilbert: JOHNSON GILBERT, GILBERT JOHNSON, J. A. GILBERT, J. GILBERT, GILBERT J., GILBERT J. A., JOHNSON A. GILBERT, J. ALBERT GILBERT, GILBERT JOHNSON A., GILBERT JOHNSON ALBERT, JOHNSON ALBERT GILBERT, GILBERT J. ALBERT, etc. –The forms shown above might all be present for different entities in the data collection. –Any algorithm designed to extract the desired information would have to consider all possibilities. –Avoided by properly identifying the lowest level of use during the design phase rather than relying on an application to obtain the desired data.

R. J. Daigle First Normal Form (1NF) (Definition) An entity type e is in FIRST NORMAL FORM (1NF) if and only if 1.e has no repeating attribute types AND 2.all attribute types of e are atomic.

R. J. Daigle Token Diagram (Abstraction). A B C D 1 D 2 E

R. J. Daigle Symbolic Table. Insertion Anomaly. b.Deletion Anomaly. c.Update Anomaly. ABCDGRADE John SmithCIS 501Accelerated ProgrammingB Tonya TuckerCIS 501Accelerated ProgrammingB Tonya TuckerCIS 502Architecture and OSA Michael BoydCIS 503Data and File StructureA George JonesCIS 502Architecture and OSB Tonya TuckerCIS 504Networks & CommunicationsC

R. J. Daigle Second Normal Form (Partial Key Dependency) An entity type e with key, K, has a Partial Key Dependency if and only if a collection of non-key attributes is determined by (or functionally dependent on) a non-empty proper subset of K.

R. J. Daigle Second Normal Form (Definition) An entity type e is in SECOND NORMAL FORM (2NF) if and only if a.e is in 1NF AND b.e has no partial key dependencies.

R. J. Daigle Example. Difficulties. A B C D

R. J. Daigle Token Diagram (Abstraction). A B C D A B C D A

R. J. Daigle Symbolic Table. a.Insertion Anomaly. b.Deletion Anomaly. c.Update Anomaly.

R. J. Daigle Third Normal Form (3NF). For A and C, attribute collections for an entity type e, there is a Transitive Dependency of C upon A if there is an attribute collection, B, of e for which a.A --> B and b.B --> C.

R. J. Daigle Third Normal Form (Definition) An entity type e is in THIRD NORMAL FORM (3NF) if and only if a.e is in 2NF AND b.e has no transitive dependencies of one non-key attribute collection upon another non-key attribute collection

R. J. Daigle Example Difficulties.

R. J. Daigle Token Diagram (Abstraction)

R. J. Daigle Symbolic Table. Insertion Anomaly. Deletion Anomaly. Update Anomaly.

R. J. Daigle Boyce-Codd Normal Form (BCNF). Attribute collections A and B of an entity type e are Candidate Keys for e if and only if a.A is a key for e and b.B is a key for e and c.A is not equal to B.

R. J. Daigle Boyce-Codd Normal Form (BCNF) (Definition) An entity type e is in BOYCE-CODD NORMAL FORM (BCNF) if and only if a.e is in 3NF AND b.all determinants of e are candidate keys.

R. J. Daigle Example. Difficulties.

R. J. Daigle T oken Diagram (Abstraction) Second Normal Form (Partial Key Dependency)

R. J. Daigle Symbolic Table. a.Insertion Anomaly. b.Deletion Anomaly. c.Update Anomaly.