4 Normal Form Nathanael Chow CS 157A Fall 2006 Dr. Lee.

Slides:



Advertisements
Similar presentations
Higher Normal Forms By John Nicosia CS 157a Fall 2007.
Advertisements

Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
Boyce-Codd NF Takahiko Saito Spring 2005 CS 157A.
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Normalisation The theory of Relational Database Design.
Normal Forms By Christopher Archibald October 16 th 2007.
4 TH NORMAL FORM & Lossless Decomposition By: Karen McVay CS 157B.
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.
Chapter 8 Normal Forms Based on Functional Dependencies Deborah Costa Oct 18, 2007.
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.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization of Database Tables
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Normalization of Database Tables
4 TH NORMAL FORM By: Karen McVay. REVIEW OF NFs 1NF  All values of the columns are atomic. That is, they contain no repeating values. 1NF  All values.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
Normalization of relational database Data redundance Second Normal Form Third Normal Form Forth Normal Form.
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
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.
Avoiding Database Anomalies
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.
Concepts of Database Management, Fifth Edition
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
The Relational Model and Normalization R. Nakatsu.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Normalization. We will take a look at –First Normal Form –Second Normal Form –Third Normal Form There are also –Boyce-Codd, Fourth and Fifth normal forms.
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.
Schema Refinement and Normal Forms 20131CS3754 Class Notes #7, John Shieh.
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Normalization of Database Lecture - ANS Yong Choi School of Business CSUB.
1 Normalization, Roberts’s Rules and Introduction to Data Modeling CSCI 6442.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Further Normalization I
Database Design – Lecture 8
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.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
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,
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Normalization.
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.
Logical Database Design and the Relational Model.
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.
Lecture 4: Logical Database Design and the Relational Model 1.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
Objectives of Normalization  To create a formal framework for analyzing relation schemas based on their keys and on the functional dependencies among.
Databases Introduction - concepts. Concepts of Relational Databases.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
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.
1. Functional dependencies Modification anomalies Major normal forms Relationship independence Practical concerns.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
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.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
4TH NORMAL FORM By: Karen McVay.
Normalization Normalization theory is based on the observation that relations with certain properties are more effective in inserting, updating and deleting.
4 Normal Form.
Presentation transcript:

4 Normal Form Nathanael Chow CS 157A Fall 2006 Dr. Lee

Overview ● 1 NF ● 2 NF ● 3 NF ● BCNF ● 4 NF ● Conclusion

Database Normalization ● Each data in the database should represent once ● Purpose of normalization: to eliminate insert, update, and delete anomalies

First Normal Form (1 NF) ● All values in the columns are atomic (simple, indivisible). This is, they contain no repeating values. ● There are no repeating groups: two columns do not store similar information in the same table. ● Basically: 1 NF is to eliminate duplicate columns

1 st Normal Form Example Un-normalized Students table: Normalized Students table: Smith123B James123A123 Class2Class1AdvRoomAdvNameAdvIDStudent# Smith123B James123A Smith123B James123A123 Class#AdvRoomAdvNameAdvIDStudent#

Second Normal Form (2 NF) ● A relation is in 2 NF if it is in 1 NF and every non-key attribute is fully functionally dependant on the primary key

2 nd Normal Form Example Students table Registration table 467Smith123B James123A123 AdvRoomAdvNameAdvIDStudent# Class#Student#

Third Normal Form (3 NF) ● A relation is in 3 NF if it is 2 NF and no transitive dependencies exist. ● Transitive dependency is a functional dependency between non-key attribute ● Basically: 3 NF is to eliminate column not depend upon the primary key.

transitive dependency Region Salesperson Name Cust_ID transitive dependency

Salesperson Name Cust_ID RegionSalesperson Region Salesperson Name Cust_ID

Boyce-Codd Normal Form (BCNF) ● A relation is in BCNF if it is in 3 NF and every determinant is a candidate key; in other words, each determinant can be used as a primary key. ● Determinant: an attribute on which some other attribute is fully functionally dependent  Ex: A --> B (A is called the determinant)

BCNF Example ● Given: R (A, B, C, D) ● A --> B, C, D ● B --> A, C, D ● C --> A, B, D ● D --> A, B, C

BCNF Example (Cont...) ● Determinants:  A, B, C, and D ● Candidate keys:  A, B, C, and D ● Since all the determinants are candidate keys, this is BCNF.

4 th Normal Form (4 NF) ● A relation is a 4 NF if it is BCNF and  There is no multivalued dependency in the relation or  There are multivalued dependency but the attributes, which are multivalued dependent on a specific attribute, are dependent between themselves ● What is a multivalued dependency (MVD)?

Definition of MVD ● A multivalued dependency X->-> Y is an assertion that if two tuples of a relation agree on all the attributes of X, then their components in the set of attributes Y may be swapped, and the result will be two tuples that are also in the relation

MVD Example R(x, y, z)

MVD Example R(x, y, z)

4 NF Example SingingArabic200 CookingEnglish200 CookingFrench100 PoliticKurdish100 TeachingEnglish100 SkillLanguageEid Assume the following relation: Employee (Eid:pk1, Language:pk2, Skill:pk3)

4 NF Example (conti...) SingingArabic200 CookingEnglish200 CookingFrench100 PoliticKurdish100 TeachingEnglish100 SkillLanguageEid Recall that a relation is in BCNF if all its determinant are candidate keys. Because relation Employee has only one determinant (Eid, Language, Skill), which is the composite primary key. Since the primary is a candidate key, R is in BCNF. Assume that there is no MVD, then this relation is 4 NF.

4 NF Example (conti...) Assume the following relation with multi-value dependency: Employee (Eid:pk1, Languages:pk2, Skills:pk3) Eid --->> LanguagesEid --->> Skills Languages and Skills are dependent. This says an employee speaks several languages and has several skills. However for each skill, a specific language is used when that skill is practiced.

4 NF Example (conti...) Thus employee 100 when she teaches, she uses English; but when she cooks, she uses French. This relation is in fourth normal form. SingingArabic200 CookingEnglish200 CookingFrench100 PoliticKurdish100 TeachingEnglish100 SkillLanguageEid

Not 4 NF Example Assume the following relation with multivalued dependency: Employee (Eid:pk1, Languages:pk2, Skills:pk3) Eid --->> LanguagesEid --->> Skills Languages and Skills are independent.

Not 4 NF Example (conti...) SingingArabic200 CookingFrench100 PoliticKurdish100 TeachingEnglish100 SkillLanguageEid Insertion anomaly: To insert row (200 English Cooking) we have to insert two extra rows (200 Arabic cooking), and (200 English Singing) otherwise the database will be inconsistent.

SingingEnglish200 CookingArabic200 CookingEnglish200 SingingArabic200 TeachingKurdish100 PoliticsEnglish100 PoliticsKurdish100 TeachingEnglish100 SkillLanguageEid Not 4 NF Example (conti...) Here is the table after the insertion:

Conclusion of Steps in Normalization

References ● html html ● ecturenotes.htm ecturenotes.htm