METU Department of Computer Eng Ceng 302 Introduction to DBMS Further Dependencies by Pinar Senkul resources: mostly froom Elmasri, Navathe and other books.

Slides:



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

Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Announcements Read 6.1 – 6.3 for Wednesday Project Step 3, due now Homework 5, due Friday 10/22 Project Step 4, due Monday Research paper –List of sources.
ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala N ATIONAL I NSTITUTE OF T ECHNOLOGY A GARTALA Aug-Dec,2010 Normalization 2 CSE-503 :: D ATABASE.
1 CS 430 Database Theory Winter 2005 Lecture 9: Fourth and Fifth Normal Forms.
Chapter 3 Notes. 3.1 Functional Dependencies A functional dependency is a statement that – two tuples of a relation that agree on some particular set.
Database Management COP4540, SCS, FIU Functional Dependencies (Chapter 14)
C.1 Appendix C: Advanced Relational Database Design Reasoning with MVDs Higher normal forms Join dependencies and PJNF DKNF.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Appendix B: Advanced.
 1 CS 728 Advanced Database Systems Chapter 15 Database Design Theory: Normalization Algorithms.
Copyright © 2004 Pearson Education, Inc.. Chapter 11 Relational Database Design Algorithms and Further Dependencies.
 10.1 CS 728 Advanced Database Systems Chapter 11 Relational Database Design Algorithms and Further Dependencies.
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 Ramez Elmasri and Shamkant B. Navathe Slide
1 Multi-valued Dependencies. 2 Multivalued Dependencies There are database schemas in BCNF that do not seem to be sufficiently normalized. Consider a.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
MVDs: 1 Join Dependencies—Example Let r = A B C = A B |  | A C 1 a x 1 a 1 x 1 a y 1 b 1 y 1 b x 2 a 2 y 1 b y 2 b 2 a y 2 b y Observe: r =  AB r | 
METU Department of Computer Eng Ceng 302 Introduction to DBMS Relational Database Design Algorithms by Pinar Senkul resources: mostly froom Elmasri, Navathe.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 11 Relational Database Design Algorithms and Further Dependencies Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Introduction to Schema Refinement
Ch 7: Normalization-Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
King Saud University College of Computer & Information Sciences Computer Science Department CS 380 Introduction to Database Systems Functional Dependencies.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Instructor: Churee Techawut Functional Dependencies and Normalization for Relational Databases Chapter 4 CS (204)321 Database System I.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide DESIGNING A SET OF RELATIONS (2) Goals: Lossless join property (a must). Dependency.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Normalization.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Relational Database Design Algorithms and Further Dependencies.
Relational Database Design Algorithms and Further Dependencies.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Chapter Functional Dependencies and Normalization for Relational Databases.
Chapter 11: Relational Database Design Algorithms and Further Dependencies Chapter 11: Relational Database Design Algorithms and Further Dependencies 1.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
FUNCTIONAL DEPENDENCIES & NORMALIZATION
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 2 Normalization Functional Dependencies Presented by: Dr. Samir Tartir.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Appendix B: Advanced.
Normalization.
Chapter 7 Functional Dependencies Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Relational Database Design Algorithms and Further Dependencies.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Relational Database Design Algorithms and Further Dependencies
CSE202 Database Management Systems
Advanced Normalization
Chapter 15 Relational Design Algorithms and Further Dependencies
CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases.
Normalization Functional Dependencies Presented by: Dr. Samir Tartir
Advanced Normalization
11/12/2018.
Relational Design Theory
Appendix C: Advanced Normalization Theory
Relational Design Theory
Relational Database Design Algorithms and Further Dependencies
Join Dependencies and Fifth Normal Form
Appendix C: Advanced Relational Database Design
Chapter 28: Advanced Relational Database Design
Presentation transcript:

METU Department of Computer Eng Ceng 302 Introduction to DBMS Further Dependencies by Pinar Senkul resources: mostly froom Elmasri, Navathe and other books

Outline Multivalued Dependencies and Fourth Normal Form Join Dependencies and Fifth Normal Form

Multivalued Dependencies and Fourth Normal Form (a) The EMP relation with two MVDs: ENAME —>> PNAME and ENAME —>> DNAME. (b) Decomposing the EMP relation into two 4NF relations EMP_PROJECTS and EMP_DEPENDENTS.

Multivalued Dependencies and Fourth Normal Form (c) The relation SUPPLY with no MVDs is in 4NF but not in 5NF if it has the JD(R1, R2, R3). (d) Decomposing the relation SUPPLY into the 5NF relations R1, R2, and R3.

Multivalued Dependencies and Fourth Normal Form Definition: A multivalued dependency (MVD) X —>> Y specified on relation schema R, where X and Y are both subsets of R, specifies the following constraint on any relation state r of R: If two tuples t 1 and t 2 exist in r such that t 1 [X] = t 2 [X], then two tuples t 3 and t 4 should also exist in r with the following properties, where we use Z to denote (R  (X  Y)): t 3 [X] = t 4 [X] = t 1 [X] = t 2 [X]. t 3 [Y] = t 1 [Y] and t 4 [Y] = t 2 [Y]. t 3 [Z] = t 2 [Z] and t 4 [Z] = t 1 [Z]. An MVD X —>> Y in R is called a trivial MVD if (a) Y is a subset of X, or (b) X  Y = R.

Multivalued Dependencies and Fourth Normal Form Inference Rules for Functional and Multivalued Dependencies: IR1 (reflexive rule for FDs): If X  Y, then X  Y. IR2 (augmentation rule for FDs): {X  Y}  XZ  YZ. IR3 (transitive rule for FDs): {X  Y, Y  Z}  X  Z. IR4 (complementation rule for MVDs): {X —>> Y}  X —>> (R – (X  Y)). IR5 (augmentation rule for MVDs): If X —>> Y and W  Z then WX —>> YZ. IR6 (transitive rule for MVDs): {X —>> Y, Y —>> Z}  X —>> (Z  Y). IR7 (replication rule for FD to MVD): {X  Y}  X —>> Y. IR8 (coalescence rule for FDs and MVDs): If X —>> Y and there exists W with the properties that (a) W  Y is empty, (b) W  –> Z, and (c) Y  Z, then X  Z.

Multivalued Dependencies and Fourth Normal Form Definition: A relation schema R is in 4NF with respect to a set of dependencies F (that includes functional dependencies and multivalued dependencies) if, for every nontrivial multivalued dependency X —>> Y in F +, X is a superkey for R. Note: F + is the (complete) set of all dependencies (functional or multivalued) that will hold in every relation state r of R that satisfies F. It is also called the closure of F.

Multivalued Dependencies and Fourth Normal Form Decomposing a relation state of EMP that is not in 4NF. (a) EMP relation with additional tuples. (b) Two corresponding 4NF relations EMP_PROJECTS and EMP_DEPENDENTS.

Multivalued Dependencies and Fourth Normal Form Lossless (Non-additive) Join Decomposition into 4NF Relations: PROPERTY: The relation schemas R 1 and R 2 form a lossless (non-additive) join decomposition of R with respect to a set F of functional and multivalued dependencies if and only if (R 1 ∩ R 2 ) —>> (R 1 - R 2 ) or by symmetry, if and only if (R 1 ∩ R 2 ) —>> (R 2 - R 1 )).

Multivalued Dependencies and Fourth Normal Form Algorithm: Relational decomposition into 4NF relations with non-additive join property Input: A universal relation R and a set of functional and multivalued dependencies F. 1. Set D := { R }; 2. While there is a relation schema Q in D that is not in 4NF do {choose a relation schema Q in D that is not in 4NF; find a nontrivial MVD X —>> Y in Q that violates 4NF; replace Q in D by two relation schemas (Q - Y) and (X  Y); };

Join Dependencies and Fifth Normal Form Definition: A join dependency (JD), denoted by JD(R 1, R 2,..., R n ), specified on relation schema R, specifies a constraint on the states r of R. The constraint states that every legal state r of R should have a non-additive join decomposition into R 1, R 2,..., R n ; that is, for every such r we have * (  R1 (r),  R2 (r),...,  Rn (r)) = r Note: an MVD is a special case of a JD where n = 2. A join dependency JD(R 1, R 2,..., R n ), specified on relation schema R, is a trivial JD if one of the relation schemas R i in JD(R 1, R 2,..., R n ) is equal to R.

Join Dependencies and Fifth Normal Form Definition: A relation schema R is in fifth normal form (5NF) (or Project-Join Normal Form (PJNF)) with respect to a set F of functional, multivalued, and join dependencies if, for every nontrivial join dependency JD(R 1, R 2,..., R n ) in F + (that is, implied by F), every R i is a superkey of R.

Relation SUPPLY with Join Dependency and conversion to Fifth Normal Form (c) The relation SUPPLY with no MVDs is in 4NF but not in 5NF if it has the JD(R1, R2, R3). (d) Decomposing the relation SUPPLY into the 5NF relations R1, R2, and R3.