COP 6726: New Directions in Database Systems

Slides:



Advertisements
Similar presentations
Functional Dependencies and Normalization for Relational Databases
Advertisements

primary key constraint foreign key constraint
Defined by Edgar Codd in 1970 Defined by Edgar Codd in 1970 Considered ingenious but impractical Considered ingenious but impractical Conceptually simple.
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.
Murali Mani Normalization. Murali Mani What and Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert,
Functional Dependencies and Normalization for Relational Databases
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
METU Department of Computer Eng Ceng 302 Introduction to DBMS Functional Dependencies and Normalization for Relational Databases by Pinar Senkul resources:
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 6 NORMALIZATION FOR RELATIONAL DATABASES Instructor Ms. Arwa Binsaleh.
King Saud University College of Computer & Information Sciences Computer Science Department CS 380 Introduction to Database Systems Functional Dependencies.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Normalization for Relational Databases.
DatabaseIM ISU1 Chapter 10 Functional Dependencies and Normalization for RDBs Fundamentals of Database Systems.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Topic 10 Functional Dependencies and Normalization for Relational Databases Faculty of Information Science and Technology Mahanakorn University of Technology.
Instructor: Churee Techawut Functional Dependencies and Normalization for Relational Databases Chapter 4 CS (204)321 Database System I.
Functional Dependencies and Normalization for Relational Databases.
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.
1 Functional Dependencies and Normalization Chapter 15.
Normalization Sept. 2012ACS-3902 Yangjun Chen1 Outline: Normalization Chapter 14 – 3rd ed. (Chap. 10 – 4 th, 5 th ed.; Chap. 6, 6 th ed.) Redundant information.
Lecture 8: Database Concepts May 4, Outline From last lecture: creating views Normalization.
Lecture9:Functional Dependencies and Normalization for Relational Databases Ref. Chapter Lecture9 1.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
What is normalization ? Proposed by Codd in 1972 Takes a relation through a series of steps to certify whether it satisfies a certain normal form Initially.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Ch 7: Normalization-Part 1
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.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Functional Dependencies and Normalization for Relational Databases تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في ذلك. حيث المرجع.
10/3/2017.
10/3/2017.
Normalization Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 19.
Functional Dependency and Normalization
CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases.
Schedule Today: Next After that Normal Forms. Section 3.6.
Functional Dependencies and Normalization for Relational Databases
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Functional Dependencies and Normalization for RDBs
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Normalization 2NF & 3NF Presented by: Dr. Samir Tartir
Functional Dependencies and Normalization for Relational Databases
Database Management systems Subject Code: 10CS54 Prepared By:
Normalization Murali Mani.
Normalization Boyce-Codd Normal Form Presented by: Dr. Samir Tartir
Sridhar Narayan Normalization Sridhar Narayan
Outline: Normalization
Normalization.
Normalization DB Design Guidelines Presented by: Dr. Samir Tartir
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
CS 405G: Introduction to Database Systems
Normalization February 28, 2019 DB:Normalization.
Sampath Jayarathna Cal Poly Pomona
Relational Database Design
Chapter Outline 1 Informal Design Guidelines for Relational Databases
Database.
Chapter 7a: Overview of Database Design -- Normalization
Functional Dependencies and Normalization
Functional Dependencies and Normalization
Presentation transcript:

COP 6726: New Directions in Database Systems Normalization

Outline Goal: Measure the quality of the logical model Normalization First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF)

What is problem? z-no name address c-id c-name c-loc grade z1 James 5th st 1 Database CM128 A 2 Data mining CM25 3 Graph theory CM100 A+ 4 Optimization CM21 C z2 Paul 11th ave B 5 Network EE221 z3 Jin 9th st D

What is problem? z-no name address c-id c-name c-loc grade z1 James 5th st 1 Database CM128 A 2 Data mining CM25 3 Graph theory CM100 A+ 4 Optimization CM21 C z2 Paul 11th ave B 5 Network EE221 z3 Jin 9th st D

Normalization Normalization is the process of decomposing large tables into smaller tables in order to eliminate redundant data and duplicate data and to avoid problems with inserting, deleting, or updating data. Goal: Information preservation Minimum redundancy.

Top Down Approach z-no name address c-id c-name c-loc grade z-no name

Semantics of attributes is clear. Informal Guideline Semantics of attributes is clear. Reducing redundant information in tuples. Reducing NULL values in tuples. Disallowing the possibility of generating spurious tuples

Insertion Anomalies Insert a new employee Employee works for ‘Research’ Department. Employee does not work for any department. Insert a new department tuple Department without an employee

Deletion Anomalies Delete a department. ‘Research’ department

Update Anomalies Update a department. Update manager in ‘Research’ department

Functional Dependency (FD) Given two tuples t1 and t2 ,and two attributes (or columns) X and Y, If t1[X] = t2 [X], then t1 [Y] = t2 [Y] Notation: X  Y Ssn  {Ename, Bdate, Address, Dnumber} Dnumber  {Dname, Dmgr_ssn} {SSN Pnumber}  {Hour} Ssn  Ename Pnumber  {Pname, Plocatoin}

Functional Dependency (FD) If X is a candidate key in a relation R, then X  R If X  Y in R, then we cannot say Y  X Ssn  {Ename, Bdate, Address, Dnumber} Dnumber  {Dname, Dmgr_ssn} {SSN Pnumber}  {Hour} Ssn  Ename Pnumber  {Pname, Plocatoin}

Functional Dependency (FD) A functional dependency is a property of the semantics or meaning of the attributes. Ssn  Ename : Ssn uniquely determines the employee name. Pnumber  {Pname, Plocation} : Project’s number uniquely determines the project names and location. {Ssn, Pnumber}  Hours : Ssn and Pnumber uniquely determines the number of hours.

Normalization Normalization process takes a relation schema though a series of tests to certify whether it satisfies a certain normal form. Minimize redundancy Minimize the insertion, deletion, and update anomalies. Normal Form (NF) 1 NF, 2NF, 3NF, Boyce-Codd normal form (BCNF)

Normalization Non-addictive Join (or lossless join) property Spurious tuples generation problem does not occurs after decomposition. Dependency property Each functional dependency is preserved after decomposition.

Basic Concept Super key Candidate key Primary key Prime attribute is a member of some candidate key. Non-prime attribute is not a prime attribute.

Basic Concept Dependency Preservation Property Every functional dependency should be preserved after decomposition. Non-addictive Join (or lossless Join) Property

First Normal Form An attribute is single atomic value.

First Normal Form

Second Normal Form FD1 : {Ssn, Pnumber}  Hours FD2 : Ssn  Ename Every non-prime attribute is full functionally dependent on any key. FD1 : {Ssn, Pnumber}  Hours FD2 : Ssn  Ename FD3 : Pnumber  {Pname, Plocation}

Second Normal Form Every non-prime attribute is full functionally dependent on any key. FD1 : {Ssn, Pnumber}  Hours FD2 : Ssn  Ename FD3 : Pnumber  {Pname, Plocation}

Third Normal Form Given FD X  A, (a) X is a superkey or (b) A is a prime attribute Transitive dependency FD1 : Ssn  {Ename, Bdate, Address, Dnumber} FD2 : Dnumber {Dname, Dmgr_ssn}

Third Normal Form Given FD X  A, (a) X is a superkey or (b) A is a prime attribute

1 NF, 2NF, 3NF

Example FD1 : Property_id#  {Country_name, Lot#, Area, Price, Tax_rate} FD2 : {County_name, Lot#} {Property_id#, Area, Price, Tax_rate} FD3 : County_name  Tax_rate FD4 : Area  Price

Example FD1 : Property_id#  {Country_name, Lot#, Area, Price, Tax_rate} FD2 : {County_name, Lot#} {Property_id#, Area, Price, Tax_rate} FD3 : County_name  Tax_rate FD4 : Area  Price

Example FD1 : Property_id#  {Country_name, Lot#, Area, Price, Tax_rate} FD2 : {County_name, Lot#} {Property_id#, Area, Price, Tax_rate} FD3 : County_name  Tax_rate FD4 : Area  Price

Normalization (Top Down Approach)

BCNF (Boyce Codd Normal Form) Given FD X  A, X is always a super key FD1 : Property_id#  {Country_name, Lot#, Area} FD2 : {County_name, Lot#} {Property_id#, Area} FD5 : Area  Country_name Third Normal Form Given FD X  A, (a) X is a superkey or (b) A is a prime attribute.

BCNF (Boyce Codd Normal Form) FD1 : Property_id#  {Country_name, Lot#, Area} FD2 : {County_name, Lot#} {Property_id#, Area} FD5 : Area  Country_name

Take Home Message Functional Dependency (FD) Non-addictive join property Dependency preservation property Normalization First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF)