Fundamentals/ICY: Databases 2012/13 WEEK 11 – 4 th Normal Form (optional material) John Barnden Professor of Artificial Intelligence School of Computer.

Slides:



Advertisements
Similar presentations
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Advertisements

Higher Normal Forms By John Nicosia CS 157a Fall 2007.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order 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.
Ch 10, Functional Dependencies and Normal forms
Fundamentals/ICY: Databases 2013/14 Week 6: Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
4NF. PTypes Planes HasType Employees MServices Auth. MWorks Assignment AppliedOn States Dates PTypes(model, capacity,…) Planes(regno, model) Employees(sin,…)
The Relational Model System Development Life Cycle Normalisation
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
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.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Relational Database Design - part 2 - Database Management Systems I Alex Coman,
1 Multivalued Dependencies Fourth Normal Form Sources: Slides by Jeffrey Ullman book by Ramakrishnan & Gehrke.
CMSC424: Database Design Instructor: Amol Deshpande
Multivalued Dependency Prof. Sin-Min Lee Department of Computer Science.
1 Multivalued Dependencies Fourth Normal Form. 2 A New Form of Redundancy uMultivalued dependencies (MVD’s) express a condition among tuples of a relation.
Normalization of Database Tables
1 Multi-valued Dependencies. 2 Multivalued Dependencies There are database schemas in BCNF that do not seem to be sufficiently normalized. Consider a.
7-1 Normalization - Outline  Modification anomalies  Functional dependencies  Major normal forms  Practical concerns.
Department of Computer Science and Engineering, HKUST Slide 1 7. Relational Database Design.
NORMALIZATION N. HARIKA (CSC).
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.
Fundamentals/ICY: Databases 2012/13 WEEK 11 (relational operators & relational algebra) John Barnden Professor of Artificial Intelligence School of Computer.
Introduction to Schema Refinement
Intro to Maths for CS: 2013/14 Sets (2) – OPTIONAL MATERIAL John Barnden Professor of Artificial Intelligence School of Computer Science University of.
FUNCTIONAL DEPENDENCIES
Lecture 12 Inst: Haya Sammaneh
Fundamentals/ICY: Databases 2010/11 WEEK 5 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Copyright © Curt Hill Schema Refinement III 4 th NF and 5 th NF.
Fundamentals/ICY: Databases 2012/13 WEEK 7 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
Fundamentals/ICY: Databases 2013/14 Week 10 –Monday –Normalization, contd John Barnden Professor of Artificial Intelligence School of Computer Science.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
Chapter 7 Normalization. Outline Modification anomalies Functional dependencies Major normal forms Relationship independence Practical concerns.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Chapter 7 Normalization. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Modification anomalies Functional dependencies.
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 Chapter 4 Normalization.
BCNF & Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
Normal Forms through BCNF CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Relational Database Design Algorithms and Further Dependencies.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
Design Process - Where are we?
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
Fundamentals/ICY: Databases 2013/14 Week 5: Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.
Multivalued Dependencies and 4th NF CIS 4301 Lecture Notes Lecture /21/2006.
Fundamentals/ICY: Databases 2012/13 Week 4 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Fundamentals/ICY: Databases 2013/14 Week 4: Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Intro to Maths for CS: 2012/13 Sets (end, week 3) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Fundamentals/ICY: Databases 2013/14 Week 11 – Monday – relations, ended. John Barnden Professor of Artificial Intelligence School of Computer Science University.
Ch 7: Normalization-Part 1
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Fundamentals/ICY: Databases 2012/13 WEEK 9 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Relational Database Design Algorithms and Further Dependencies.
Final Review Zaki Malik November 20, Basic Operators Covered.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
Logical Database Design and the Rational Model
Fundamentals/ICY: Databases 2010/11 WEEK 6
Fundamentals/ICY: Databases 2013/14 WEEK 6 - Friday
Presentation transcript:

Fundamentals/ICY: Databases 2012/13 WEEK 11 – 4 th Normal Form (optional material) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

Fourth Normal Form (4NF) uAbout a different sort of issue from 2NF/3NF/BCNF. Those NFs are concerned with the redundancy from functional dependencies (FDs). u4NF is concerned with redundancy resulting from multivalued dependencies (MVDs).

Fourth Normal Form (4NF), contd. uA multivalued dependency of some attribute X on an attribute-set D is like a functional dependency except that X sometimes has several values for a given value of D. The crucial point is that once the D value is specified, the X values are independent of other attributes. So, we can think of X as a multivalued attribute implemented by putting different values in different rows, where the set of X values is fully determined by just the value of D. E.g.: imagine multivalued car-colour being determined by just the make and year of the car.

Notes re Multivalued Dependencies uCaution: some books take functional dependencies to be just a special case of multivalued dependencies. So all dependencies are technically “multiple”, but some actually involve multiplicity and some don’t. uThe determinant D in a (truly) multivalued dependency cannot be a superkey, because if it were then there could only be one X value per D value. uThe D/X association doesn’t violate 2NF, 3NF or BCNF because it’s not a functional dependency. u“Trivial” multivalued dependencies include those where D together with X forms a superkey (including the case where there are no other attributes). Trivial MVDs avoid the problem on the next slide.

Fourth Normal Form u[R,C&C and R&C:] A table is in 4NF if l It is in 3NF and l It does not have multiple multivalued dependencies u[Garcia-Molina et al.:] A table is in 4NF if l It is in BCNF l It does not have any non-trivial multivalued dependencies

Example of Multiple MDs uExample: an employee may be assigned to several work assignments and may, independently of that, help several different charitable organizations. uIf we try to use one table, we have l a multivalued dependency of assignment on (say) employee-id l a multivalued dependency of charitable-org on employee-id

Three Ways of Trying to Encode the two multivalued dependencies (Figure no. shown is from R&C 6 th ed. It is 5.10 in 7 th ed, and Fig in R,C&C.)

Problems with those Multiple MDs uThose methods cause wasted space, redundancy, and/or additional manipulation complexity (with distinct possibility of getting the manipulation wrong). uBecause of NULL values it may be difficult to define a good or any PK. May need to replace NULLs by some other special value.

A Set of Tables in 4NF (Figure no. shown is from 6 th ed. of textbook. It is 5.11 in 7 th ed., and 7.11 in R,C&C)

Notes on the Resulting Tables 1)Tables ASSIGNMENT and SERVICE_V1 are bridging tables. 2)The PK of SERVICE_V1 consists of both its attributes. 3)The PK of ASSIGNMENT is meant to be ASSIGN_NUM. But note that the other 2 columns also form a candidate key. 4)Each of the tables in the diagram is in 4NF, under both definitions of 4NF. A.Each table is in BCNF (and hence 3NF), and B.The only tables containing MVDs are ASSIGNMENT and SERVICE_V1, and C.In each of these tables, there is only one MVD, with determinant = EMP_NUM, and D.Each of these MVDs is trivial: the attributes involved in it (the “D” together with the “X”) is a superkey.

Problems even with a Single MVD 1)Suppose there is an attribute Z (different from X) that is not determined by D together with X, such as SIZE. (Hence, also, Z is not determined by D by itself.) Then there are different represented objects (e.g. cars) with different values of Z but the same value of D and X, and each such object needs to have rows in the table to cover all the different values of X (e.g., red, blue and green) associated with that value of D. So we get redundancy of representation of the D/X association (same problem as with e.g. partial and transitive dependencies, but now worse because of the multi-valuedness of X). Notice that the above situation can only happen if the MVD is non-trivial. If the MVD were trivial you wouldn’t be able to have a Z as above.

Problems with a Single MD, contd. 2)Just the problem covered earlier in module concerning car-colour: if there is another attribute Y in the table and Y is determined by D, then: either it has a value repeated in all the different rows holding the different X values for a single D value, so we get redundancy of the representation of the D/Y association or if, say, NULLs are used instead of repeating the Y value, we get extra manipulation complexity in handling/maintaining Y.

Problems with a Single MD, contd. uBut note that problem 2 is prevented from arising if the table is in BCNF, because D has to be a non- superkey determinant (of Y), and this is disallowed by BCNF. uSimilarly, get some such protection from problem 2 if the table is in 3NF or just 2NF. uBut BCNF etc. don’t prevent either problem 1 or special problems arising from the interaction of different multivalued dependencies.