Fourth normal form: 4NF 1. 2 Normal forms desirable forms for relations in DB design eliminate redundancies avoid update anomalies enforce integrity constraints.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Summary of Convergence Tests for Series and Solved Problems
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 10 second questions
Relational data objects 1 Lecture 6. Relational data objects 2 Answer to last lectures activity.
5NF and other normal forms
1 Term 2, 2004, Lecture 3, NormalisationMarian Ursu, Department of Computing, Goldsmiths College Normalisation 5.
Query optimisation.
Functional dependencies 1. 2 Outline motivation: update anomalies cause: not expressed constraints on data (FDs) functional dependencies (FDs) definitions.
Relational data integrity
Dependency preservation, 3NF revisited and BCNF
Normal forms - 1NF, 2NF and 3NF
Conceptual / semantic modelling
1 Term 2, 2004, Lecture 2, Normalisation - IntroductionMarian Ursu, Department of Computing, Goldsmiths College Normalisation Introduction.
1 Term 2, 2007, Lectures 2/3, NormalisationD. Tidhar (based on M. Ursu) Department of Computing, Goldsmiths College Normalisation 5.
Lecture 7 Enhanced Entity-Relationship Modelling & Advanced Normalisation.
CS 319: Theory of Databases
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
Richmond House, Liverpool (1) 26 th January 2004.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
Green Eggs and Ham.
VOORBLAD.
Quadratic Inequalities
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Lecture plan Outline of DB design process Entity-relationship model
Introduction to Feedback Systems / Önder YÜKSEL Bode plots 1 Frequency response:
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Functional Dependencies and Normalization for Relational Databases
Addition 1’s to 20.
25 seconds left…...
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
Copyright © Cengage Learning. All rights reserved.
Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
Copyright © 2004 Pearson Education, Inc.. Chapter 10 Functional Dependencies and Normalization for Relational Databases.
1 Multi-valued Dependencies. 2 Multivalued Dependencies There are database schemas in BCNF that do not seem to be sufficiently normalized. Consider a.
Further Normalization II: Higher Normal Forms Prof. Yin-Fu Huang CSIE, NYUST Chapter 13.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts.
Database Design Dr. M.E. Fayad, Professor
Fourth normal form: 4NF.
Database Design Dr. M.E. Fayad, Professor
Presentation transcript:

Fourth normal form: 4NF 1

2 Normal forms desirable forms for relations in DB design eliminate redundancies avoid update anomalies enforce integrity constraints in one sentence: produce a good representation of the real world formally defined, based on semantic concepts not a panacea

Fourth normal form: 4NF 3 2NF, 3NF and BCNF defined based on FDs decomposition procedure : projection any relation can be brought to any (of the above) NF accompanied by normalisation procedures

Fourth normal form: 4NF 4 4NF based on another semantic concept (not FDs) (i.e. capturing different semantic aspects (constraints) of the real life system)

Fourth normal form: 4NF 5 Motivation - 4NF courses - tutors - reference books assumptions for a course - any number of tutors and any numbers of books a book can be used for any number of courses a tutor can teach any number of courses no link between tutors and books (!!!)

Fourth normal form: 4NF 6 Un-normalised relation (CTB) CTB

Fourth normal form: 4NF 7 1N relation

Fourth normal form: 4NF 8 Note IF(c1, t1, b1) and (c1, t2, b2) exist as tuples in the relation THEN (c1, t1, b2) and (c1, t2, b1) also exist in the relation

Fourth normal form: 4NF 9 Question what normal forms is this relation in? helping question what functional dependencies can you identify?

Fourth normal form: 4NF 10 Shortcomings redundancy therefore: update anomalies e.g. add a new tutor, C. Fox, for the Databases course: both tuples, (Databases, C. Fox, Introduction to DB) and (Databases, C. Fox, DB Design), have to be added could you think of a better solution? this is a problem BCNF relation what do you conclude about the studied normal forms?

Fourth normal form: 4NF 11 Common-sense solution separate independent repeating groups decompose the un-normalised relation bring it to 1NF the solution: shortcomings - removed non-loss decomposition

Fourth normal form: 4NF 12 Decompose the un-normalised relation

Fourth normal form: 4NF 13 Bring to 1NF

Fourth normal form: 4NF 14 Solution what is the theoretical basis? not FDs (there arent any) multi-valued dependencies (MVDs) generalisation of FDs e.g. Course Tutor each course has a well defined set of tutors in the relation CTB, Tutor depends on the value of Course alone (Book does not influence)

Fourth normal form: 4NF 15 Multi-valued dependency - simple Let R be a relation and A and B arbitrary sets of attributes of R. There is a multi-valued dependency from A to B A B if and only each A value exactly determines a set of B values, independently of the other attributes

Fourth normal form: 4NF 16 Multi-valued dependency - Date Let R be a relation; A, B and C are arbitrary sets of attributes of R A multi-determines B (B is multi-dependent on A) A B if and only if the set of B values matching an (A, C) pair depends only on the A value.

Fourth normal form: 4NF 17 Multi-valued dependency (Elmasri and Navathe, 2000, p. 514) Let R be a relation and X and Y arbitrary sets of attributes of R ; if for any 2 tuples (in any extension) t 1 and t 2 with the property t 1 [X] = t 2 [X] there exists 2 tuples t 3 and t 4 such that (Z = R - (X Y)) t 1 [X] = t 3 [X] = t 4 [X] t 1 [Y] = t 3 [Y] and t 2 [Y] = t 4 [Y] t 1 [Z] = t 2 [Z] and t 3 [Z] = t 4 [Z] then X Y

Fourth normal form: 4NF 18 Trivial MVDs R, is a relation; X and Y arbitrary sets of attributes of R X Y is trivial if and only if Y X or X Y = R a trivial MVD does not represent a constraint

Fourth normal form: 4NF 19 Questions is every FD a MVD? is every MVD a FD?

Fourth normal form: 4NF 20 Towards 4NF MVDs are a generalisation of FDs the existence of non-trivial MVDs that are not FDs causes problems AIM: to eliminate such situations

Fourth normal form: 4NF 21 Theorems R (A, B, C) and A B A C (A B | C) (Fagin) R (A, B, C) R = join ({A, B}, {A, C}) if and only if A B | C

Fourth normal form: 4NF 22 4NF R is in 4NF if and only if any MVD is either trivial, or it is also a FD (Connolly): A relation is in 4NF if and only if it is in BCNF and contains no non-trivial multi-valued dependencies can you spot the error in the definition? 4NF is always achievable

Fourth normal form: 4NF 23 Fagins theorem Let R = (A, B, C) and A ->> B | C then R = (A, B) join (A, C) similar in form with the variant for FDs

Fourth normal form: 4NF 24 Example

Fourth normal form: 4NF 25 Discussion R = (Patient, Disease, Doctor) a patient has a number of diseases and, independently of them is assigned a number of doctors; therefore Patient ->> Disease | Doctor each disease is treated by a certain number of doctors and, independently of this, there is a certain number of patients that suffer from each disease; therefore: Disease ->> Doctor | Patient a patient, for a certain disease, is assigned only one doctor; therefore: (Patient, Disease) -> Doctor and NO MVDs exist

Fourth normal form: 4NF 26 Discussion R = (Patient, Disease, Doctor) each patient suffers from a number of diseases (independently of doctors) and each disease is treated by a number of doctors (independently of the patients that suffer from it); can we say that Patient ->> Disease and Disease ->> Doctor ? have we not already discussed the above case?

Fourth normal form: 4NF 27 Discussion what about R = (Patient, Disease, Treatment, Nurse) where a patient can have a number of diseases (independently of treatments and nurses) a disease has a number of treatments (independently of patients and nurses); a treatment is administered by a number of nurses (independently of patients and diseases).

Fourth normal form: 4NF 28 Discussion what about R = (Patient, Disease, Doctor, Nurse) where a patient has a number of diseases independently of doctors and nurses a patient has a unique doctor for a given disease a doctor has (works with) a number of nurses, independently of patients and diseases

Fourth normal form: 4NF 29 Conclusion 2NF, 3NF and BCNF based on FDs there are other constraints that can be expressed through projection multi-valued dependency 4NF Fagin