The Relational Model Chapter Two Functional Dependency.

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

Normalization Process: Exercise 2: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. (Attorney, ClientNumber, MeetingDate)
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How.
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.
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 3-1 David M. Kroenke Database Processing Chapter 3 Normalization.
Normalization I.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
The Relational Model Chapter Two (Excerpts) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Chapter 2. The Relational Model (cont.) IST2101. Review: Functional Dependency A relationship between attributes: some attribute(s) determine the value.
Lecture 12 Inst: Haya Sammaneh
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.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
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.
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
Normalization Transparencies
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.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
The Relational Model Chapter Two DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
The Relational Model Chapter Two DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Normalization Process: Exercise 1: Step 1 IST2101 Step 1. Identify all the candidate keys of the relation. StudentNumber.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Chapter 13 Normalization Transparencies Last Updated: 08 th May 2011 By M. Arief
Chapter 10 Normalization Pearson Education © 2009.
Chapter 2. The Relational Model (cont.)
THE RELATIONAL MODEL II IST 210: Organization of Data IST210 1.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
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.
Chapter 2. The Relational Model (cont.) IST2101. Review: Determinant vs. Candidate Key IST2102 DeterminantsCandidate Key (StudentID, CourseID) StudentID.
+ 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,
© 2002 by Prentice Hall 1 The Relational Model David M. Kroenke Database Concepts 1e Chapter 2 2.
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.
ITD1312 Database Principles Chapter 4C: Normalization.
Databases Introduction - concepts. Concepts of Relational Databases.
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
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
Adapted from DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 Functional Dependencies and Normalization.
Normalization.
CSIS 115 Database Design and Applications for Business
The Relational Model and Database Normalization
Normalization Karolina muszyńska
The Relational Model Chapter Two DATABASE CONCEPTS, 3rd Edition
A brief summary of database normalization
Normalization Referential Integrity
Database Processing: David M. Kroenke’s Chapter Three:
Copyright © 2018, 2015, 20 Pearson Education, Inc. All Rights Reserved Database Concepts Eighth Edition Chapter # 2 The Relational Model.
Presentation transcript:

The Relational Model Chapter Two Functional Dependency

2 A relationship between attributes in which one attribute (or group of attributes) determines the value of another attribute in the same table A relationship between attributes in which one attribute (or group of attributes) determines the value of another attribute in the same table Illustration… Illustration… The price of one cookie can determine the price of a box of 12 cookies The price of one cookie can determine the price of a box of 12 cookies (CookiePrice, Qty)BoxPrice

3 Determinants The attribute (or attributes) that we use as the starting point (the variable on the left side of the equation) is called a determinant The attribute (or attributes) that we use as the starting point (the variable on the left side of the equation) is called a determinant (CookiePrice, Qty)BoxPrice Determinant

4 Functional Dependency Example Given different color objects: Red objects – 5 pounds Blue objects – 3 pounds Yellow objects – 7 pounds If you look in a bag and see an object, the weight of the bag is determined by the color of the object. ObjectColor  Weight

5 Functional Dependency Example Given different color objects: Red objects – Ball shape Blue objects – Cube shape Yellow objects – Cube shape The ObjectColor also determines shape. ObjectColor  Shape

6 Functional Dependency Example So, ObjectColor determines both Weight and Shape. ObjectColor  (Weight, Shape)

7 Functional Dependency Example Represent this data as a Relational Table… OBJECT (ObjectColor, Weight, Shape) ObjectColorWeightShape Red5Ball Blue3Cube Yellow7Cube

8 Candidate/Primary Keys and Functional Dependency By definition… A candidate key of a relation will functionally determine all other attributes in the row By definition… A candidate key of a relation will functionally determine all other attributes in the row Likewise, by definition… A primary key of a relation will functionally determine all other attributes in the row Likewise, by definition… A primary key of a relation will functionally determine all other attributes in the row

9 Primary Key and Functional Dependency Example (EmployeeID) (EmpLastName, EmpPhone) (ProjectID)(ProjectName, StartDate)

10 Normalization Normalization is a process of analyzing a relation to ensure that it is well-formed Normalization is a process of analyzing a relation to ensure that it is well-formed More specifically, if a relation is normalized (well-formed), rows can be inserted, deleted, or modified without creating update anomalies More specifically, if a relation is normalized (well-formed), rows can be inserted, deleted, or modified without creating update anomalies

11 Normalization Example Given: ADVISER-LIST (AdviserID, AdviserName, Dept, Phone, Office, StudentNum, StudentName) Given: ADVISER-LIST (AdviserID, AdviserName, Dept, Phone, Office, StudentNum, StudentName) Valid Relational table by the rules defined earlier! So StudentNum  (AdviserID, AdviserName, Dept, Phone, Office, StudentName) Relation: ADVISER-LIST (AdviserID, AdviserName, Dept, Phone, Office, StudentNum, StudentName)

12 Normalization Example An Advisor’s phone number can appear in multiple rows. Take out advisor information. An Advisor’s phone number can appear in multiple rows. Take out advisor information. Functional Dependency: Functional Dependency: AdviserID  (AdviserName, Dept, Phone, Office) This Relation is poorly formed because it has a functional dependency that does NOT involve the primary key! i.e. AdviserID is a determinant of a functional dependency but it is NOT a candidate key!

13 Normalization Principles Relational design principles for normalized relations: Relational design principles for normalized relations: To be a well-formed relation, every determinant must be a candidate key To be a well-formed relation, every determinant must be a candidate key Any relation that is not well formed should be broken into two or more well-formed relations. Any relation that is not well formed should be broken into two or more well-formed relations.

14 Normalization Process Normalization is the process of examining relations and modifying them to make them well-formed. Normalization is the process of examining relations and modifying them to make them well-formed. You can categorize problems into different types called normal forms. You can categorize problems into different types called normal forms. Any relation that has characteristics presented in Fig 2-1 is called First Normal Form. Any relation that has characteristics presented in Fig 2-1 is called First Normal Form. Others: Second, Third, Boyce-Codd, Fourth, Fifth and domain/key normal form. Others: Second, Third, Boyce-Codd, Fourth, Fifth and domain/key normal form.

15 Normalization Process 1. Identify all candidate keys of the relation. 2. Identify all functional dependencies in the relation. 3. Exampine the determinants of the functional dependencies. If any determinant is NOT a candidate key, the relation has normalization problems. In this case…

16 Normalization Process 3a. Place the columns of the functional dependency in a new relation of their own. 3b. Make the determinant the functional dependency of the primary key of the new relation. 3c. Leave a copy of the determinant as a foreign key in the original relation. 3d. Create a referential integrity constraint between the original relation and the new relation.

17 Normalization Process 4. Repeat step 3 as many times as necessary until every determinant of every relation is a candidate key.