IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.

Slides:



Advertisements
Similar presentations
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
4N and the Normalization of Multivalue Dependency By: Laith Alnagem.
Topic Database Normalisation S McKeever Advanced Databases 1.
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Normalisation Ensuring data integrity in database design 1.
Normalization of Database Tables
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
CS263:Revision on Normalisation
The Relational Database Model:
Database Normalization Il-Han Yoo CS 157A Professor: Sin-Min Lee.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
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.
Week 6 Lecture Normalization
Lecture 12 Inst: Haya Sammaneh
Database Management System Lecture 6 The Relational Database Model – Keys, Integrity Rules.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
IMS 6217: Primary Key Reference 1 Dr. Lawrence West, MIS Dept., University of Central Florida Primary Keys Uniqueness of Table Rows Identifier.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Database Systems: Design, Implementation, and Management Tenth Edition
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
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.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
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.
Normalization Copyright © 1999 Patrick McDermott College of Alameda
By Andrew Yee. Why 4NF? Performance – We want database to take up less space.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
What's a Database A Database Primer Let’s discuss databases n Why they are hard n Why we need them.
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.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
IMS 4212: Data Modeling—Attributes 1 Dr. Lawrence West, Management Dept., University of Central Florida Attributes and Domains Nonkey.
IMS 4212: Data Modeling—More Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Data Modeling—Topics.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
1 Functional Dependencies and Normalization Chapter 15.
1 5 Chapter 5 Database Design 1: Some Normalization Examples Spring 2006.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
Normalization of Database Tables
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
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.
Normalizing Your Database CPT 242. Normalization The procedure where the developer analyzes the data and establishes the table structure to create the.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-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,
Normalization Example. Database Systems, 8 th Edition 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
IMS 6217: Database Design & Entities 1 Dr. Lawrence West, MIS Dept., University of Central Florida Database Design--Topics DB Design.
Lecture 4: Logical Database Design and the Relational Model 1.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Logical Database Design and Relational Data Model Muhammad Nasir
Lecture # 17 Chapter # 10 Normalization Database Systems.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
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.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Normalization Karolina muszyńska
Module 5: Overview of Normalization
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Chapter 7a: Overview of Database Design -- Normalization
Presentation transcript:

IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency Candidate Keys Normalization –1 st Normal Form –2 nd Normal Form –3 rd Normal Form –Boyce-Codd, 4 th & 5 th Normal Forms

IMS 4212: Normalization 2 Dr. Lawrence West, Management Dept., University of Central Florida Functional Dependency Functional dependency refers to the relationship between nonkey attributes and the primary key (or other attributes) of an entity Attribute A is functionally dependent on Attribute B if, having specified a value for Attribute B, there is only one true value for Attribute A E.g., if we identify a student by specifying their SSN there is only one current value of last name –Note that time dependency may come into play but we will handle that as with any time-dependent data

IMS 4212: Normalization 3 Dr. Lawrence West, Management Dept., University of Central Florida Functional Dependency (cont.) An attribute may be functionally dependent on a composite set of attributes E.g., the name of a course is functionally dependent on the course identified by Department Code and Course Number

IMS 4212: Normalization 4 Dr. Lawrence West, Management Dept., University of Central Florida Functional Dependency (cont.) Note that we don't define functional dependency to mean that there is only one possible value of the functionally dependent attribute –A student can change their name or address –A product can get a new price Identifying functional dependencies is a critical step in the normalization that follows Our goal is a structure in which each attribute in an entity is functionally dependent on only the PK and on the whole PK

IMS 4212: Normalization 5 Dr. Lawrence West, Management Dept., University of Central Florida Candidate Keys We use the term "Candidate Key" to indicate that an entity may have multiple attributes or sets of composite attributes that could be primary keys (uniquely identify each record) What are the candidate keys in the entity above? One candidate key is always selected as the PK Other(s) become alternate keys (AK) –Uniqueness must be enforced –May not be null (usually) –More on alternate keys later

IMS 4212: Normalization 6 Dr. Lawrence West, Management Dept., University of Central Florida Normalization Normalization is the process of distributing attributes among entities to achieve an efficient DB structure –Ensures entity satisfies six properties of relations (earlier lecture) –Ensure functional dependency on PK A fully normalized database has tremendous storage and retrieval advantages over a poorly designed DB We will look (later) at selectively denormalizing entities to achieve performance efficiencies

IMS 4212: Normalization 7 Dr. Lawrence West, Management Dept., University of Central Florida Normalization (cont.) Normalization consists of six steps –1 st Normal Form (1NF) –2 nd Normal Form(2NF) –3 rd Normal Form(3NF) –Boyce-Codd Normal Form(BCNF) –4 th Normal Form(4NF) –5 th Normal Form(5NF)

IMS 4212: Normalization 8 Dr. Lawrence West, Management Dept., University of Central Florida Normalization (cont.) Normalization is applied to entities An entity is said to be in 3NF, for example, if it has been checked for compliance with the rules of 3NF and any necessary corrections applied Each normalization step is applied in order –You do not attempt to put an entity in 2NF until it has been checked and corrected to be in 1NF –Etc. Corrections to normalization problems almost always result in the creation of new entities and relationships

IMS 4212: Normalization 9 Dr. Lawrence West, Management Dept., University of Central Florida First Normal Form "Place entities in 1NF by removing any repeating attributes" –Repeating attribute are multivalued attributes in another guise and are problems for the same reason –The definition doesn't tell you what to do with them Handle as with multivalued attributes –Create new entity –PK is PK of original entity plus the repeated attribute

IMS 4212: Normalization 10 Dr. Lawrence West, Management Dept., University of Central Florida Second Normal Form "Place entities in 2NF by placing them in 1NF and then ensuring that each nonkey attribute is fully functionally dependent on the whole primary key" Remove the offending attributes to a new entity –PK is the portion of the PK on which the problem attribute is dependent 2NF problems cannot exist in an entity with a single-attribute PK

IMS 4212: Normalization 11 Dr. Lawrence West, Management Dept., University of Central Florida Third Normal Form "Place entities in 3NF by placing them in 2NF and removing any transitive dependencies" A 'transitive dependency' is an attribute that is functionally dependent on another nonkey attribute (or set of attributes) which, in turn, is functionally dependent on the PK The problem attribute(s) are dependent on the PK but only because the intermediary attribute is dependent

IMS 4212: Normalization 12 Dr. Lawrence West, Management Dept., University of Central Florida Third Normal Form (cont.) If the value of the PK changes (i.e., we move to a new record) the value of the dependent attributes (as well as all other attributes) could change The problem arises because changing the value of the nonkey intermediary attribute also forces a change to the dependent attributes May also be a problem with redundant storage

IMS 4212: Normalization 13 Dr. Lawrence West, Management Dept., University of Central Florida Third Normal Form (cont.) Place entities in 3NF by removing the offending attributes to a new entity –The intermediate attribute(s) will become the PK of the new entity –New PK will remain in original entity as a foreign key –Attributes with transitive dependency will be removed to the new entity

IMS 4212: Normalization 14 Dr. Lawrence West, Management Dept., University of Central Florida Other Normal Forms Boyce-Codd, 4NF, and 5NF deal with unusual circumstances Boyce-Codd NF requires that each attribute be functionally dependent on any candidate key, not just the selected PK 4NF requires that independently multivalued composite PK attributes be removed to two new parent entities 5NF requires the removal of pairwise cyclic dependencies within composite primary keys with three or more component attributes

IMS 4212: Normalization 15 Dr. Lawrence West, Management Dept., University of Central Florida 4 th Normal Form Violation RestaurantPizza VarietyDelivery Area Vincenzo's PizzaThick CrustSpringfield Vincenzo's PizzaThick CrustShelbyville Vincenzo's PizzaThin CrustSpringfield Vincenzo's PizzaThin CrustShelbyville Elite PizzaThin CrustCapital City Elite PizzaStuffed CrustCapital City A1 PizzaThick CrustSpringfield A1 PizzaThick CrustShelbyville A1 PizzaThick CrustCapital City A1 PizzaStuffed CrustSpringfield A1 PizzaStuffed CrustShelbyville A1 PizzaStuffed CrustCapital City

IMS 4212: Normalization 16 Dr. Lawrence West, Management Dept., University of Central Florida Fix by splitting two independent PK components into two new entities Note that if there are attributes dependent on a subset of the original key this violates 2NF 4 th Normal Form (cont.) Varieties By Restaurant RestaurantPizza Variety Vincenzo's PizzaThick Crust Vincenzo's PizzaThin Crust Elite PizzaThin Crust Elite PizzaStuffed Crust A1 PizzaThick Crust A1 PizzaStuffed Crust Delivery Areas By Restaurant RestaurantDelivery Area Vincenzo's PizzaSpringfield Vincenzo's PizzaShelbyville Elite PizzaCapital City A1 PizzaSpringfield A1 PizzaShelbyville A1 PizzaCapital City

IMS 4212: Normalization 17 Dr. Lawrence West, Management Dept., University of Central Florida Fifth Normal Form If entities satisfy 4NF it will be rare that they violate 5NF and will do so only when certain constraints on allowable values apply. See Wikipedia for an example