4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.

Slides:



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

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.
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.
NORMALIZATION. Normalization Normalization: The process of decomposing unsatisfactory "bad" relations by breaking up their attributes into smaller relations.
4NF and 5NF Prof. Sin-Min Lee Department of Computer Science.
1 Loss-Less Joins. 2 Decompositions uDependency-preservation property: enforce constraints on original relation by enforcing some constraints on resulting.
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.
Boyce-Codd normal form (BCNF) Kai Zhu CS157B Professor: Dr. Lee.
4NF. PTypes Planes HasType Employees MServices Auth. MWorks Assignment AppliedOn States Dates PTypes(model, capacity,…) Planes(regno, model) Employees(sin,…)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
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.
1 Multivalued Dependencies Fourth Normal Form Sources: Slides by Jeffrey Ullman book by Ramakrishnan & Gehrke.
Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover.
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.
Fall 2001Arthur Keller – CS 1804–1 Schedule Today Oct. 4 (TH) Functional Dependencies and Normalization. u Read Sections Project Part 1 due. Oct.
Normalization II. Boyce–Codd Normal Form (BCNF) Based on functional dependencies that take into account all candidate keys in a relation, however BCNF.
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.
1 Normalization Anomalies Boyce-Codd Normal Form 3 rd Normal Form.
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.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Database Normalization.
Further Normalization II: Higher Normal Forms Prof. Yin-Fu Huang CSIE, NYUST Chapter 13.
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.
BCNF & Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 11 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.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
4NF (Multivalued Dependency), and 5NF (Join Dependency)
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) 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,
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Normalization.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
3 Spring Chapter Normalization of Database Tables.
Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.
Multivalued Dependencies and 4th NF CIS 4301 Lecture Notes Lecture /21/2006.
Ch 7: Normalization-Part 1
Functional Dependencies Zaki Malik September 25, 2008.
Databases 1 Sixth lecture. 2 Functional Dependencies X -> A is an assertion about a relation R that whenever two tuples of R agree on all the attributes.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
Final Review Zaki Malik November 20, Basic Operators Covered.
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.
Al-Imam University Girls Education Center Collage of Computer Science 1 nd Semester, 1432/1433H Chapter 10_part2 Functional Dependencies and Normalization.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
Design Theory for Relational Databases Functional Dependencies Decompositions Normal Forms: BCNF, Third Normal Form Introduction to Multivalued Dependencies.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 Lecture 8 Design Theory for Relational Databases (part 2) Slides from
1 Database Design: DBS CB, 2 nd Edition Physical RDBMS Model: Schema Design and Normalization Ch. 3.
Schedule Today: Jan. 23 (wed) Week of Jan 28
3.1 Functional Dependencies
CPSC-310 Database Systems
Multivalued Dependencies & Fourth Normal Form (4NF)
Mulitvalued Dependencies
Multivalued Dependencies & Fourth Normal Form
Multivalued Dependencies & Fourth Normal Form
Multivalued Dependencies
Presentation transcript:

4NF & MULTIVALUED DEPENDENCY By Kristina Miguel

Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate key – a minimal superkey  Primary key – a chosen candidate key  Secondary key – all the rest of candidate keys  Prime attribute – an attribute that is a part of a candidate key (key column)  Non-prime attribute – a non-key column

Review (cont.)  1NF  Eliminate repeating groups. Make a separate table for each set of related attributes, and give each table a primary key.  2NF  Eliminate redundant data. Each attribute must be functionally dependent on the primary key. If an attribute depends on only part of a multi-valued key, remove it to a separate table.  3NF  Eliminate columns not dependent on key. If attributes do not contribute to a description of the key, remove them to a separate table. Any transitive dependencies are moved into a smaller table.  BCNF  Every determinant in the table is a candidate key. If there are non-trivial dependencies between candidate key attributes, separate them out into distinct tables.  All normal forms are additive, in that if a model is in 3NF, it is by definition also in 2NF and 1NF.

Multivalued Dependency (MVD)  A MVD X  Y,  Holds for some relation R, so that when you fix the values for one set of attributes, then the values in certain other attributes are independent of the values of all the other attributes in the relation.  Is an assertion that two attributes or sets of attributes are independent of one another.  For each value of X, the values of Y are independent of the values of R-X-Y.

MVD (cont.)  More precisely, for MVD A  B  For each pair of tuples t and u of 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, and With u on all attributes of R that are not among the A’s or B’s.

MVD (cont.)  Representation of X  Y XY others equal exchange

MVD Example Drinkers(name, addr, phones, beersLiked)  A drinker’s phones are independent of the beers they like.  name  phones and name  beersLiked.  Thus, each of a drinker’s phones appears with each of the beers they like in all combinations.

MVD Example (cont.)  Tuples Implied by name  phones  If we have tuples:  Then these tuples must also be in the relation. nameaddrphones beersLiked sueap1 b1 sueap2 b2 sueap2 b1 sueap1 b2

4NF  Definition  A relation R is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X  Y, X is a superkey—that is, X is either a candidate key or a superset thereof. Nontrivial MVD means that: 1. Y is not a subset of X, and 2. X and Y are not, together, all the attributes.

Decomposition into 4NF  If X  Y is a 4NF violation for relation R, we can decompose R using the same technique as for BCNF. 1. XY is one of the decomposed relations. 2. All but Y – X is the other.

Decomposition into 4NF Method  Find a 4NF violation in R, say A  B, where A is not a superkey.  If there is such a 4NF violation, break the schema for the relation R that has the 4NF violation into two schemas. 1. R1, whose schema is A’s and B’s. 2. R2, whose schema is the A’s and all attributes of R that are not among the A’s or B’s.  Find the FD’s and MVD’s that hold in R1 and R2. Recursively decompose R1 and R2 with respect to their projected dependencies.

4NF Decomposition Example Drinkers(name, addr, phones, beersLiked) FD: name  addr MVD’s: name  phones name  beersLiked  Key is {name, phones, beersLiked}.  All dependencies violate 4NF.

4NF Decomposition Example (cont.)  Decompose using name  addr: 1. Drinkers1(name, addr)  In 4NF; only dependency is name  addr. 2. Drinkers2(name, phones, beersLiked)  Not in 4NF. MVD’s name  phones and name  beersLiked apply. No FD’s, so all three attributes form the key.

4NF Decomposition Example (cont.)  Decompose Drinkers2  Either MVD name ->-> phones or name ->-> beersLiked tells us to decompose to: Drinkers3(name, phones) Drinkers4(name, beersLiked)

Summary  A multivalued dependency is a statement that two sets of attributes in a relation have sets of values that appear in all possible combinations.  If a relation is in 4NF, then every nontrivial MVD is really an FD with a superkey on the left.

References  l l  ds77.pdf ds77.pdf  