Mulitvalued Dependencies

Slides:



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

Functional Dependencies (FDs)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
METU Department of Computer Eng Ceng 302 Introduction to DBMS Further Dependencies by Pinar Senkul resources: mostly froom Elmasri, Navathe and other books.
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.
Multivalued Dependency Prof. Sin-Min Lee Department of Computer Science.
1 Multi-valued Dependencies Salman Azhar Multi-valued Dependencies Fourth Normal Form These slides use some figures, definitions, and explanations from.
1 Multivalued Dependencies Fourth Normal Form Source: Slides by Jeffrey Ullman.
1 Multivalued Dependencies Fourth Normal Form. 2 Definition of MVD uA multivalued dependency (MVD) on R, X ->->Y, says that if two tuples of R agree on.
Functional Dependencies Definition: If two tuples agree on the attributes A, A, … A 12n then they must also agree on the attributes B, B, … B 12m Formally:
Multivalued Dependency Prof. Sin-Min Lee Department of Computer Science.
Winter 2002Arthur Keller – CS 1804–1 Schedule Today: Jan. 15 (T) u Normal Forms, Multivalued Dependencies. u Read Sections Assignment 1 due. Jan.
1 Multivalued Dependencies Fourth Normal Form. 2 A New Form of Redundancy uMultivalued dependencies (MVD’s) express a condition among tuples of a relation.
Multivalued Dependencies by Asmerom Tekeste. Normal Forms 1NF 2NF 3NF BCNF 4NF 5NF Functional dependencies Multivalued dependencies Join dependencies.
Multivalued Dependencies. Intuition Redundancy: addresses, title repeated several times –because a star might have several addresses and stars in several.
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Normalization Goal = BCNF = Boyce-Codd Normal Form = all FD’s follow from the fact “key  everything.” Formally, R is in BCNF if for every nontrivial FD.
Copyright © Curt Hill Schema Refinement III 4 th NF and 5 th NF.
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.
Revisit FDs & BCNF Normalization 1 Instructor: Mohamed Eltabakh
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
4NF (Multivalued Dependency), and 5NF (Join Dependency)
1 Lecture 7: Normal Forms, Relational Algebra Monday, 10/15/2001.
© D. Wong Ch. 3 (continued)  Database design problems  Functional Dependency  Keys of relations  Decompositions based on Functional Dependency.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
Multivalued Dependencies and 4th NF CIS 4301 Lecture Notes Lecture /21/2006.
CS411 Database Systems Kazuhiro Minami 04: Relational Schema Design.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
Normalization Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Chapter 19.
Advanced Normalization
Chapter 15 Relational Design Algorithms and Further Dependencies
Higher Forms of Normalization
CS411 Database Systems 08: Midterm Review Kazuhiro Minami 1.
Relational Database Design by Dr. S. Sridhar, Ph. D
Schedule Today: Jan. 23 (wed) Week of Jan 28
Chapter 8: Relational Database Design
3.1 Functional Dependencies
Advanced Normalization
Normal forms First Normal Form (1NF) Second Normal Form (2NF)
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Problems in Designing Schema
Relational Design Theory
Functional Dependencies and Normalization
CPSC-310 Database Systems
Module 5: Overview of Normalization
Chapter 7: Relational Database Design
Functional Dependencies and Normalization
Multivalued Dependencies & Fourth Normal Form (4NF)
Functional Dependencies and Normalization
Functional Dependencies and Relational Schema Design
Multivalued Dependencies & Fourth Normal Form
Multivalued Dependencies & Fourth Normal Form
Appendix C: Advanced Normalization Theory
Relational Design Theory
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Functional Dependencies
CS 405G: Introduction to Database Systems
Instructor: Mohamed Eltabakh
Relational Database Design
Third Normal Form.
Multivalued Dependencies
Appendix C: Advanced Relational Database Design
Chapter 28: Advanced Relational Database Design
Lecture 6: Functional Dependencies
Chapter 3: Multivalued Dependencies
Chapter 3: Design theory for relational Databases
Chapter 7a: Overview of Database Design -- Normalization
Presentation transcript:

Mulitvalued Dependencies

What functional dependencies are obeyed? 1. name → area_code phone email birthdate Josh 253 549-6382 nahumjos@msu.edu 1988-11-01 517 352-8593 Hancheng 382 543-5436 grading_sux@aol.com 1999-12-31 best_teacher@gmail.com Tyler 123-4567 josh_is_silly@msu.edu 1965-03-14 What functional dependencies are obeyed? 1. name → area_code phone 2. name → email 3. name → birthdate 4. None of the above Note, the data is made up, don't get any presents.

name →→ area_code phone name →→ email Josh 253 123-4567 nahumjos@msu.edu 517 111-1111 best_teacher@gmail.com Hancheng 382 543-5436 grading_sux@aol.com Tyler josh_is_silly@msu.edu name birthdate Josh 1988-11-01 Hancheng 1999-12-31 Tyler 1965-03-14 But there is still redundancy!!! There's multiple combinations of phone numbers and email. name →→ area_code phone name →→ email name email Josh nahumjos@msu.edu best_teacher@gmail.com Hancheng grading_sux@aol.com Tyler josh_is_silly@msu.edu name area_code phone Josh 253 123-4567 517 111-1111 Hancheng 382 543-5436 Tyler

Multivalued Dependency A multivalued dependency (MVD) is a statement about some relationship R that when you fix the values for one set of attributes, then the values in certain other attributes are independent of that values of all other attributes in the relation. A1, A2, ..., An →→ B1, B2, ..., Bm holds for a relation R if when we restrict ourselves to the tuples of R that have particular values for each of the attributes among the A's, then the set of values we find among the B's is independent of the set of values we find among the attributes of R that are not among the A's or B's. This MVD holds if: For each pair of tuples t and u of a relation R that agree on all the A's, we can find in R some tuple v that agrees: With both t and u on the A's With t on the B's With u on all attributes of R that are not among the A's or B's.

X →→ Y X Y rest X1 Y1 R1 Y2 R2 ...

Rules regarding MVD's Trivial MVD's: Transitive Rule: FD Promotion: A1, A2, ..., An →→ B1, B2, ..., Bm holds in any relation if {B1, B2, ..., Bm } is a subset of {A1, A2, ..., An } Transitive Rule: if A1, A2, ..., An →→ B1, B2, ..., Bm and B1, B2, ..., Bm →→ C1, C2, ..., Ck then A1, A2, ..., An →→ C1, C2, ..., Ck FD Promotion: Every FD is an MVD if A1, A2, ..., An → B1, B2, ..., Bm, then A1, A2, ..., An →→ B1, B2, ..., Bm Complementation Rule: if A1, A2, ..., An →→ B1, B2, ..., Bm, then A1, A2, ..., An →→ C1, C2, ..., Ck where C are all attributes not among A's and B's

No Splitting Rule for MVD name →→ area_code phone Cannot be split into: name →→ phone name →→ area_code Why? Because the area_code and phone are a group that together form a unit. If you broke them apart, You would make area_code and phone independent, and all possible combinations would need to be present.

Proving All FD's are MVD's X → Y then X →→ Y X Y rest X1 Y1 R1 Y2 == Y1 R2 ...

Fourth Normal Form This form avoids redundancy regarding multivalued dependencies, and is basically identical in approach to Third Normal Form. A relation R is in fourth normal form (4NF) if whenever A1, A2, ..., An →→ B1, B2, ..., Bm is a nontrivial MVD, and {A1, A2, ..., An} is a superkey.

Decomposition into 4NF Input: A relation R0 with a set of functional and multivalued dependencies S0. Output: A decomposition of R0 into relations, all of which are in 4NF. The decomposition has the lossless-join property. Method: Do the following steps, with R = R0: Find a 4NF violation in R, say A1, A2, ..., An →→ B1, B2, ..., Bm, where {A1, A2, ..., An} is not a superkey. Note this MVD could be a true MVD, or it could be a FD (A1, A2, ..., An → B1, B2, ..., Bm,), since every FD is an MVD. If there is none, return R. If there is such a 4NF violation, break the schema for the relation R that has the 4NF violation into two schema: R1, whose schema is A's and B's. R2, whose schema is the A's and all attributes of R that are not among A's and B's. Find the FD's and MVD's that hold in R1 and R2. Recursively decompose R1 and R2 with respect to the respective dependences.