Chapter 4 The Relational Model and Normalization.

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.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
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 3-1 COS 346 Day 5.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
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.
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.
SLIDE 1IS 257 – Fall 2004 Database Design: Normalization and The Relational Model University of California, Berkeley School of Information.
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.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Why Normalization? To Reduce Redundancy to 1.avoid modification, insertion, deletion anomolies 2.save space Goal: One Fact in One Place.
Chapter 3 The Relational Model and Normalization
Lecture 12 Inst: Haya Sammaneh
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.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
(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.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
The Relational Model and Normalization R. Nakatsu.
1 A Guide to MySQL 2 Database Design Fundamentals.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
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.
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.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
Data Analysis Improving Database Design. Normalization The process of transforming a data model into a flexible, stable structure. Reduces anomalies Anomaly.
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.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
+ Relational Model IST210 Class Lecture. + Premiere Products A new company that is going to sells random merchandise via sales representatives You have.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
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.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
Lecture 4: Logical Database Design and the Relational Model 1.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Normalization ACSC 425 Database Management Systems.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
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.
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
Payroll Management System
The Relational Model and Normalization
Relational Model and ER Model: in a Nutshell
Database 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:

Chapter 4 The Relational Model and Normalization

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 2 Relations  Relational DBMS products store data in the form of relations, a special type of table  A relation is a two-dimensional table that has the following characteristics Rows contain data about an entity Columns contain data about attributes of the entity All entries in a column are of the same kind Each column has a unique name Cells of the table hold a single value The order of the columns is unimportant The order of the rows is unimportant No two rows may be identical  Although not all tables are relations, the terms table and relation are normally used interchangeably Table/row/column = file/record/field = relation/tuple/attribute

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 3 Example: Relation

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 4 Example: Tables Not Relations

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 5 Functional Dependencies  A functional dependency occurs when the value of one (set of) attribute(s) determines the value of a second (set of) attribute(s)  The attribute on the left side of the functional dependency is called the determinant SID  GPA SKU  Department, SKU_Description (CustomerNumber, ItemNumber, Quantity)  Price  Mathematically, we say that “A” determines “B”, A  B  – Physically, we might say that “A” is a unique identifier for “B”

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke Functional Dependency (2)  Full Functional Dependency: “B” is functionally dependent on “A” but not on any subset of “A”  Transitive Dependency: If “B” and “C” are both dependent on “A”, but “C” is also dependent on “B”, we say that “C” is transitively dependent on “B” 6

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 7 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  Normalization works through classes of relations called normal forms

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 8 Relationship of Normal Forms

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 9 Normal Forms  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

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 10 Example: 2NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 11 Example: NOT IN 3NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 12 Example: 3NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 13 Example: NOT IN BCNF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 14 Example: BCNF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 15 Another Example: NOT IN BCNF CUSTOMER IDTool TypeTool trainer ID CUSTOMER ID + Tool Type  Tool Trainer ID CUSTOMER ID + Tool TRAINER ID is also an candidate key (unique) Tool TRAINER ID  Tool Type Specialized tool maker CUSTOMER IDTool trainer IDTool TypeTool trainer ID

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 16 Example: NOT IN 4NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 17 Example: 4NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 18 Example: 4NF CUSTOMER IDTool TypesFavorite Sports CUSTOMER IDTool Types CUSTOMER IDFavorite Sports

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 19 DK/NF  First published in 1981 by Fagin  DK/NF has no modification anomalies; so no higher normal form is needed  A relation is in DK/NF if every constraint on the relation is a logical consequence of the definition of keys and domains

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 20 Example 1: DK/NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 21 Example: DK/NF

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 22 Normal Forms-Review  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

Database Processing: Fundamentals, Design and Implementation, 9/e by David M. Kroenke 23 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)