Multivalued Dependency Tamer Abuelata. Introduction Goal in Databases: Goal in Databases: BCNF (Boyce Codd Normal Form) BCNF (Boyce Codd Normal Form)

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Schema Refinement: Canonical/minimal Covers
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Lecture 21 CS 157 B Revision of Midterm3 Prof. Sin-Min Lee.
Normalization Decomposition techniques for ensuring: Lossless joins Dependency preservation Redundancy avoidance We will look at some normal forms: Boyce-Codd.
Schema Refinement and Normal Forms Given a design, how do we know it is good or not? What is the best design? Can a bad design be transformed into a good.
METU Department of Computer Eng Ceng 302 Introduction to DBMS Further Dependencies by Pinar Senkul resources: mostly froom Elmasri, Navathe and other books.
Relational Normalization Theory. Limitations of E-R Designs Provides a set of guidelines, does not result in a unique database schema Does not provide.
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.
©Silberschatz, Korth and Sudarshan Relational Database Design First Normal Form Pitfalls in Relational Database Design Functional Dependencies Decomposition.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
Multivalued Dependency Prof. Sin-Min Lee Department of Computer Science.
Functional Dependency CS157a Sec. 2 Koichiro Hongo.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
Multivalued Dependency Prof. Sin-Min Lee Department of Computer Science.
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Decomposition By Yuhung Chen CS157A Section 2 October
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 | 
Department of Computer Science and Engineering, HKUST Slide 1 7. Relational Database Design.
Boyce-Codd Normal Form By: Thanh Truong. Boyce-Codd Normal Form Eliminates all redundancy that can be discovered by functional dependencies But, we can.
Introduction to Schema Refinement
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Database Systems Normal Forms. Decomposition Suppose we have a relation R[U] with a schema U={A 1,…,A n } – A decomposition of U is a set of schemas.
Copyright © Curt Hill Schema Refinement III 4 th NF and 5 th NF.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design Pitfalls in.
Relational Database Design by Relational Database Design by Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING.
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide DESIGNING A SET OF RELATIONS (2) Goals: Lossless join property (a must). Dependency.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
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.
Computing & Information Sciences Kansas State University Tuesday, 27 Feb 2007CIS 560: Database System Concepts Lecture 18 of 42 Tuesday, 27 February 2007.
Computing & Information Sciences Kansas State University Wednesday, 04 Oct 2006CIS 560: Database System Concepts Lecture 17 of 42 Wednesday, 04 October.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Appendix B: Advanced.
Copyright, Harris Corporation & Ophir Frieder, The Process of Normalization.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
Multivalued Dependencies and 4th NF CIS 4301 Lecture Notes Lecture /21/2006.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
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.
Computing & Information Sciences Kansas State University Friday, 03 Oct 2007CIS 560: Database System Concepts Lecture 16 of 42 Wednesday, 03 October 2007.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Advanced Normalization
Chapter 15 Relational Design Algorithms and Further Dependencies
Module 5: Overview of Database Design -- Normalization
Relational Database Design by Dr. S. Sridhar, Ph. D
Chapter 8: Relational Database Design
3.1 Functional Dependencies
Advanced Normalization
11/12/2018.
Relational Design Theory
Relational Design Theory
Fourth normal form: 4NF.
Module 5: Overview of Normalization
Chapter 7: Relational Database Design
Normalization.
Relational Design Theory
Instructor: Mohamed Eltabakh
Designing Relational Databases
Relational Database Design
Appendix C: Advanced Relational Database Design
Chapter 28: Advanced Relational Database Design
Chapter 7a: Overview of Database Design -- Normalization
Presentation transcript:

Multivalued Dependency Tamer Abuelata

Introduction Goal in Databases: Goal in Databases: BCNF (Boyce Codd Normal Form) BCNF (Boyce Codd Normal Form) Losslessness Losslessness Dependency preservation Dependency preservation

Remember… Boyce Codd Normal Form (BCNF) eliminates all redundancy that can be discovered based on functional dependencies.

Issue Some relation schemas, even though they are in BCNF, do not seem to be sufficiently normalized. Some relation schemas, even though they are in BCNF, do not seem to be sufficiently normalized. They still contain repetitions They still contain repetitions

Case study Consider the bank database schema: cust_loan = (loan_number, cust_id, cust_name, cust_street, cust_city) This is BCNF because of the functional dependency: cust_id -> cust_name, cust_street cust_city And because cust_id is not a key for cust_loan

Case Study But what if some customers have several addresses? But what if some customers have several addresses? We no longer wish to enforce the func. dependency: cust_id ->cust_street cust_city But we still want to enforce cust_id -> cust_name

Case Study Following BCNF decomposition algorithm Following BCNF decomposition algorithm we get: R1 = (cust_id, cust_name) R2 = (loan_number, cust_id, cust_street, cust_city) (both in BCNF)

Case Study The issue Despite R2 in BCNF, there is redundancy. We repeat the address of each residence for each loan that the customer has.

Case Study We can therefore decompose further into: loan_cust_id = (loan_number, cust_id) cust_residence = (cust_id, cust_street, cust_city) But there is no constraint that lead us to do that. To deal with this, we need a few form of constraint: 4NF.

4NF We can use multivalued dependencies to define the fourth normal form

4NF A relation schema R is in fourth normal form with respect to a set D of functional and multivalued dependencies if, for all multivlued dependencies in D+ of the form A -->-> B at least one of the following holds: A -->-> B is a trivial multivalued dependency A -->-> B is a trivial multivalued dependency A is a superkey for schema R A is a superkey for schema R

Multivalued Dependency Requires that other tuples of a certain form be present in the relation. Requires that other tuples of a certain form be present in the relation. Also referred to as: Also referred to as: tuple-generating dependency

Example R relation schema, A and B follow the multivalued dependency: R relation schema, A and B follow the multivalued dependency: A -->-> B The relationship between A and B is independent of the relation between A and R – B The relationship between A and B is independent of the relation between A and R – B If A -->-> B is satisfied by all relations on R then If A -->-> B is satisfied by all relations on R then A -->-> B is a trivial multivalued dependency A -->-> B is a trivial multivalued dependency

Example Let’s reconsider Let’s reconsider R2 = (loan_number, cust_id, cust_street, cust_city) loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester L LakeHorseneck

Example loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester L LakeHorseneck We must repeat the loan number once for each address a customer has and we must repeat the address for each loan a customer has.

Example loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester L LakeHorseneck This repetition is unnecessary since the relationship between a customer and his address is independent of the relationship between that customer and a loan.

Example Therefore this relation is illegal Therefore this relation is illegal loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester

Example loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester To make it legal we should add tuples To make it legal we should add tuples (L23, , Main, Manchester) and (L27, , North, Rye)

Example loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester L MainManchester L NorthRye Updated table (legal) Updated table (legal)

Example loan_numbercust_idcust_streetcust_city L NorthRye L MainManchester L MainManchester L NorthRye We want Cust_id -->-> cust_street cust_city We want Cust_id -->-> cust_street cust_city to hold

Conclusion We can use multivalued dependencies To test relations to determine whether they are legal under a given set of functional and multivalued dependencies To test relations to determine whether they are legal under a given set of functional and multivalued dependencies To specify constraints on the set of legal relations To specify constraints on the set of legal relations