Normalization February 28, 2019 DB:Normalization.

Slides:



Advertisements
Similar presentations
Functional Dependencies and Normalization for Relational Databases
Advertisements

NORMALIZATION. Normalization Normalization: The process of decomposing unsatisfactory "bad" relations by breaking up their attributes into smaller relations.
Ch 10, Functional Dependencies and Normal forms
Functional Dependencies and Normalization for Relational Databases.
Ms. Hatoon Al-Sagri CCIS – IS Department Normalization.
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Normalization I.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
IS 230Lecture 8Slide 1 Normalization Lecture 9. IS 230Lecture 8Slide 2 Lecture 8: Normalization 1. Normalization 2. Data redundancy and anomalies 3. Spurious.
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
King Saud University College of Computer & Information Sciences Computer Science Department CS 380 Introduction to Database Systems Functional Dependencies.
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: >
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
DatabaseIM ISU1 Chapter 10 Functional Dependencies and Normalization for RDBs Fundamentals of Database Systems.
Normalization Transparencies
CSC271 Database Systems Lecture # 28.
Functional Dependencies and Normalization for Relational Databases.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
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.
Lecture 5 Normalization. Objectives The purpose of normalization. How normalization can be used when designing a relational database. The potential problems.
Chapter 13 Normalization Transparencies Last Updated: 08 th May 2011 By M. Arief
Chapter 10 Normalization Pearson Education © 2009.
1 Functional Dependencies and Normalization Chapter 15.
Lecture 8: Database Concepts May 4, Outline From last lecture: creating views Normalization.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u How to undertake process of normalization. u How to identify most commonly used normal.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
Lecture Nine: Normalization
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,
Database Design FUNCTIONAL DEPENDENCES NORMAL FORMS D. Christozov / G.Tuparov INF 280 Database Systems: DB design: Normal Forms 1.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
Al-Imam University Girls Education Center Collage of Computer Science 1 nd Semester, 1432/1433H Chapter 10_part2 Functional Dependencies and Normalization.
ITD1312 Database Principles Chapter 4C: Normalization.
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.
Functional Dependencies and Normalization for Relational Databases تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في ذلك. حيث المرجع.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
10/3/2017.
Normalization.
COP 6726: New Directions in Database Systems
Functional Dependency and Normalization
CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases.
Normalization DBMS.
Functional Dependencies and Normalization for Relational Databases
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Functional Dependencies and Normalization for RDBs
Normal forms First Normal Form (1NF) Second Normal Form (2NF)
Chapter 14 Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Database Management systems Subject Code: 10CS54 Prepared By:
Database Normalization
Chapter 14 & Chapter 15 Normalization Pearson Education © 2009.
Normalization – Part II
Normalization Dale-Marie Wilson, Ph.D..
Sridhar Narayan Normalization Sridhar Narayan
Outline: Normalization
Normalization.
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Chapter 14 Normalization.
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Database Normalisation
Sampath Jayarathna Cal Poly Pomona
Chapter Outline 1 Informal Design Guidelines for Relational Databases
Chapter 14 Normalization Pearson Education © 2009.
Presentation transcript:

Normalization February 28, 2019 DB:Normalization

Objectives Introduction + Objectives of Normalization + Normal Forms + The Process of Normalization + Un Normalized Form (UNF) + Converting UNF to Normalized Form + Summary + February 28, 2019 DB:Normalization

- Introduction A process to validate and improve logical design so that it satisfies certain constraints that avoid unnecessary duplication of the data. Normalization is a formal technique for analyzing a relation based on its primary key and the FDs between the attributes of that relation. The normalization process was first proposed by Codd 1972. The normalization process takes a relation schema through a series of tests to certify whether it satisfies a certain normal form. February 28, 2019 DB:Normalization

- Objectives of Normalization Solve problems associated with redundant data. Identify various types of update anomalies such as insertion, deletion, and modification anomalies. Recognize the appropriateness or quality of the design of relations. Use FDs to group attributes into relations that are in a known normal form. February 28, 2019 DB:Normalization

- Normal Forms The four most commonly used normal forms are: First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF) To convert un-normalized table to a normalized one, you first convert it to INF, then to 2NF, then to 3NF and then to BCNF. In other words: UNF  1NF  2NF  3NF  BCNF February 28, 2019 DB:Normalization

-- Relationship Between Normal Forms February 28, 2019 DB:Normalization

- The Process of Normalization Formal technique for analyzing a relation based on its primary key and the functional dependencies between the attributes of that relation. Often executed as a series of steps. Each step corresponds to a specific normal form, which has known properties. As normalization proceeds, the relations become progressively more restricted (stronger) in format and also less vulnerable to update anomalies. February 28, 2019 DB:Normalization

- Unnormalized Form (UNF) A table would be in unnormalized form if it contains some multi-valued attributes or repeating groups. To create an unnormalized table Transform the data from the information source (e.g. form) into table format with columns and rows. Example: Dname Dnumber DMGRSSN Dlocations Research 5 222 Dammam, Khobar, Dhahran Administration 4 333 Jubail Headquarters 1 444 Khobar DEPARTMENT February 28, 2019 DB:Normalization

- Converting From UNF to Normalized Form UNF to 1NF + Example: UNF to 1NF + 2NF + 1NF to 2NF + Example: 1NF to 2NF + 3NF + 2NF to 3NF + Example: 2NF to 3NF + BCNF + 3NF to BCNF + Example: 3NF to BCNF + February 28, 2019 DB:Normalization

-- First Normal Form (1NF) A relation in which the intersection of each row and column contains one and only one value. February 28, 2019 DB:Normalization

-- UNF to 1NF Nominate an attribute or group of attributes to act as the key for the unnormalized table. Identify the repeating group(s) in the unnormalized table which repeats for the key attribute(s). Remove the repeating group by Entering appropriate data into the empty columns of rows containing the repeating data (‘flattening’ the table). Or by Placing the repeating data along with a copy of the original key attribute(s) into a separate relation. February 28, 2019 DB:Normalization

-- Example: UNF to 1NF UNF 1NF Dname Dnumber DMGRSSN Dlocations Research 5 222 Dammam, Khobar, Dhahran Administration 4 333 Jubail UNF Dname Dnumber DMGRSSN Dlocations Research 5 222 Dammam Khobar Dhahran Administration 4 333 Jubail 1NF February 28, 2019 DB:Normalization

-- Second Normal Form (2NF) Based on the concept of full functional dependency. Full functional dependency indicates that if A and B are attributes of a relation, B is fully dependent on A if B is functionally dependent on A but not on any proper subset of A. Example: In the last table {SSN, Pnumber}  Hours is a full dependency. (neither SSN  Hours nor Pnumber  hours hold. A relation that is in 1NF and every non-primary-key attribute is fully functionally dependent on the primary key. February 28, 2019 DB:Normalization

-- 1NF to 2NF If a primary key is a single attribute then the relation is already in 2NF. In the case of composite key, the following steps are applied to convert to 2NF: Identify the primary key for the 1NF Identify the functional dependencies in the relation If partial dependency exists on the primary key remove them by placing them in a new relation along with a copy of their determinant. February 28, 2019 DB:Normalization

--- Example: 1NF to 2NF 1NF 2NF FD1 SSN Pnumber Hours Ename Pname Plocation FD2 Get Rid of FD1 SSN Ename SSN Pnumber Hours Pname Plocation FD2 Get Rid of FD2 2NF SSN Ename SSN Pnumber Hours Pnumber Pname Plocation February 28, 2019 DB:Normalization

-- Third Normal Form (3NF) 3NF is based on the concept of transitive dependency. Transitive Dependency is a condition where A, B and C are attributes of a relation such that if A  B and B  C, then C is transitively dependent on A through B. (Provided that A is not functionally dependent on B or C). February 28, 2019 DB:Normalization

-- 2NF to 3NF Identify the primary key in the 2NF relation. Identify functional dependencies in the relation. If transitive dependencies exist on the primary key remove them by placing them in a new relation along with a copy of their dominant. February 28, 2019 DB:Normalization

-- Example: 2NF to 3NF 3NF EMP_DEPT Ename SSN Bdate Address Dnumber Dname DMGRSSN Transitive FD Get Rid of Transitive FD Ename SSN Bdate Address Dnumber Dnumber Dname DMGRSSN EMPLOYEE DEPARTMENT 3NF February 28, 2019 DB:Normalization

-- Boyce-Codd Normal Form (BCNF) Based on functional dependencies that takes into account all candidate keys in a relation. For a relation with only one candidate key, 3NF and BCNF are equivalent. A relation is in BCNF, if and only if every determinant is a candidate key. Violation of BCNF may occur in a relation that contains two (or more) composite keys which overlap and share at least one attribute in common. February 28, 2019 DB:Normalization

-- 3NF to BCNF Identify all candidate keys in the relation. Identify all functional dependencies in the relation. If functional dependencies exists in the relation where their determinants are not candidate keys for the relation, remove the functional dependencies by placing them in a new relation along with a copy of their determinant. February 28, 2019 DB:Normalization

-- Example: 3NF to BCNF A B C D E BCNF Normalization A C D E D B February 28, 2019 DB:Normalization

Steps in Normalization - Summary … Steps in Normalization February 28, 2019 DB:Normalization

… - Summary Definition A functional dependency X  A is called trivial if, A  X. A relation is in 1NF if, and only if, every attribute is single-valued for each tuple. A relation is in 2NF if, and only if, it is in 1NF and all the non-key attributes are fully functionally dependent on the key. A relation is in 3NF if, when ever a non-trivial functional dependency X A exists, then either X is a superkey or A is a member of some candidate key. A relation is in BCNF if, whenever a non-trivial functional dependency X  A exists, then X is a superkey. February 28, 2019 DB:Normalization