Announcements Read 6.1 – 6.3 for Wednesday Project Step 3, due now Homework 5, due Friday 10/22 Project Step 4, due Monday Research paper –List of sources.

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Lossless-join Jan. 2012Yangjun Chen ACS Outline: Lossless-join Chapter 15 – 3rd ed. (Chap. 15 – 4 th, 5 th ed.; Chap. 16, 6 th ed.) Basic definition.
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.
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.
Temple University – CIS Dept. CIS616– Principles of Data Management V. Megalooikonomou Functional Dependencies (based on notes by Silberchatz,Korth, and.
Database Management COP4540, SCS, FIU Functional Dependencies (Chapter 14)
Properties of Armstrong’s Axioms Soundness All dependencies generated by the Axioms are correct Completeness Repeatedly applying these rules can generate.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Functional Dependencies and Normalization for Relational Databases
CMSC424: Database Design Instructor: Amol Deshpande
Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover.
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
METU Department of Computer Eng Ceng 302 Introduction to DBMS Relational Database Design Algorithms by Pinar Senkul resources: mostly froom Elmasri, Navathe.
Chapter 11 Relational Database Design Algorithms and Further Dependencies Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Computing & Information Sciences Kansas State University Monday, 13 Oct 2008CIS 560: Database System Concepts Lecture 18 of 42 Monday, 13 October 2008.
Announcements Read 5.8 – 5.13 for Monday Project Step 3, due Monday 10/18 Homework 4, due Friday 10/15 – by (or turn in Monday in class)
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Topic 10 Functional Dependencies and Normalization for Relational Databases Faculty of Information Science and Technology Mahanakorn University of Technology.
Instructor: Churee Techawut Functional Dependencies and Normalization for Relational Databases Chapter 4 CS (204)321 Database System I.
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.
SCUJ. Holliday - coen 1784–1 Schedule Today: u Normal Forms. u Section 3.6. Next u Relational Algebra. Read chapter 5 to page 199 After that u SQL Queries.
BCNF & Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
Computing & Information Sciences Kansas State University Tuesday, 27 Feb 2007CIS 560: Database System Concepts Lecture 18 of 42 Tuesday, 27 February 2007.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Relational Database Design Algorithms and Further Dependencies.
Relational Database Design Algorithms and Further Dependencies.
Chapter Functional Dependencies and Normalization for Relational Databases.
Chapter 11: Relational Database Design Algorithms and Further Dependencies Chapter 11: Relational Database Design Algorithms and Further Dependencies 1.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
CS 564 Database Management Systems: Design and Implementation Discussion Session Friday, Sept 18, Apul Jain.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 2 Normalization Functional Dependencies Presented by: Dr. Samir Tartir.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
Announcements Program 3 due Friday Homework 2 out today, due Mon Read: Chapter 3.
CS 222 Database Management System Spring Lecture 5 Database Design (Decomposition) Korra Sathya Babu Department of Computer Science NIT Rourkela.
Chapter 7 Functional Dependencies Copyright © 2004 Pearson Education, Inc.
Databases Illuminated Chapter 6 Normalization. Objectives of Normalization Develop a good description of the data, its relationships and constraints Produce.
Databases Illuminated
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
© 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.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
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.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Normal Forms Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems June 18, 2016 Some slide content courtesy of Susan Davidson.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Functional Dependencies and Normalization 1 Instructor: Mohamed Eltabakh Part 2.
Functional Dependency and Normalization
Advanced Normalization
Normalization Functional Dependencies Presented by: Dr. Samir Tartir
Advanced Normalization
Functional Dependencies and Normalization
Outline: Normalization
Presentation transcript:

Announcements Read 6.1 – 6.3 for Wednesday Project Step 3, due now Homework 5, due Friday 10/22 Project Step 4, due Monday Research paper –List of sources - due 10/29

Normalization Lecture 14

Algorithmic Test for Lossless Join Given a relation R(A1, A2, …, An), a set of functional dependencies, F, and a decomposition of R into relations R1, R2, …, Rm 1.Construct an m by n table S, with a column for each of the n attributes in R and a row for each of the m relations in the decomposition 2.For each cell S(i,j) of S, If the attribute for the column, Aj, is in the relation for the row, Ri, then place the symbol a(j) in the cell; else place the symbol b(i,j) there

Algorithmic Test for Lossless Join (Continued) 3.Repeat the following process until no more changes can be made to S: For each FD X → Y in F For all rows in S that have the same symbols in the columns corresponding to the attributes of X, make the symbols for the columns that represent the attributes of Y equal by the following rule: if any row has an a value, a(j), then set the value of that column in all other rows equal to a(j) if no row has an a value, then pick any one of the b values, say b(i,j), and all the other rows equal to b(i,j) 4.If, after all possible changes have been made to S, a row is made up entirely of a symbols, a(1), a(2), …, a(n), then the join is lossless. It there is no such row, the join is lossy.

R = {SSN, ENAME, PNUMBER, PNAME, PLOCATION, HOURS} R1 = EMP_LOCS={ENAME, PLOCATION} R2 = EMP_PROJ1={SSN, PNUMBER, HOURS, PNAME, PLOCATION} F={SSN→ENAME; PNUMBER→{PNAME, PLOCATION}; {SNN, PNUMBER}→HOURS SSNENAMEPNUMBERPNAMEPLOCATIONHOURS R1 R2

R = {SSN, ENAME, PNUMBER, PNAME, PLOCATION, HOURS} R1 = EMP={SSN, ENAME} R2 = PROJ={PNUMBER, PNAME, PLOCATION} R3 = WORKS_ON={SSN, PNUMBER, HOURS} F={SSN→ENAME; PNUMBER→{PNAME, PLOCATION}; {SNN, PNUMBER}→HOURS SSNENAMEPNUMBERPNAMEPLOCATIONHOURS R1 R2 R3

Lossless Projections Lossless property guaranteed if for each pair of relations that will be joined, the set of common attributes is a superkey of one of the relations Binary decomposition of R into {R 1,R 2 } has the lossless join property with respect to a set of functional dependencies F on R iff one of these holds The FD ((R1 ∩ R2) → (R1 - R2)) is in F + or The FD (( R1 ∩ R2) → (R2 - R1 )) is in F + If projection is done by successive binary projections, can apply binary decomposition test repeatedly

Multi-valued Dependency In R(A,B,C) if each A values has associated with it a set of B values and a set of C values such that the B and C values are independent of each other, then Multi-valued dependencies Example: JointAppoint(facId, dept, committee) assuming a faculty member can belong to more than one department and belong to more than one committee

4NF A table is 4NF if Example: remove MVDs in JointAppoint

5NF and DKNF A relation is 5NF A relation is in Domain-Key Normal Form (DKNF)

De-normalization When to stop the normalization process –

Inference Rules for FDs Armstrong’s Axioms –Reflexivity –Augmentation –Transitivity Additional rules that follow: –Additivity –Projectivity –Pseudotransitivity

Closure of Set of FDs If F is a set of functional dependencies for a relation R, then the set of all functional dependencies that can be derived from F, F +, is called the closure of F Could compute closure by applying Armstrong’s Axioms repeatedly

Closure of an Attribute If A is an attribute or set of attributes of relation R, all the attributes in R that are functionally dependent on A in R form the closure of A, A + Computed by Closure Algorithm for A, Section result ← A; while (result changes) do for each functional dependency B → C in F if B is contained in result then result ← result  C; end; A + ← result;

Uses of Attribute Closure Can determine if A is a superkey- Can determine whether a given FD X→Y is in the closure of the set of FDs. (Find X +, see if it includes Y)

Redundant FDs Given a set of FDs, can determine if any of them is redundant, i.e. can be derived from the remaining FDs, by a simple algorithm

Algorithm for Determining Redundancy 1.Choose a candidate FD, say X → Y, and remove it from the set of FDs 2.result ← X; while (result changes and Y is not contained in result) do for each FD, A → B, remaining in the reduced set of FDs If A is a subset of result, then result ← result  B end 3.if Y is a subset of result, then the FD X → Y is redundant

Covers If a relation R has two sets of FDs, F and G –then F is a cover for G if every FD in G is also in F + –F and G are equivalent if F is a cover for G and G is a cover for F (i.e. F + = G + )

Minimal Set of FDs Set of FDs, F is minimal if –

Minimal Cover for Set of FDs A minimal cover for a set of FDs is a cover such that no proper subset of itself is also a cover A set of FDs may have several minimal covers

Algorithm for Finding Minimal Cover 1.Set F ← G 2.For each FD in F that is not in canonical form, i.e. of the form X → {Y1, Y2, …, Yn}, replace if by the n FDs X → Y1, X → Y2, …, X → Yn; 3.Eliminate extraneous attributed: For each FD X → Y in F for each attribute A that is an element of X if ((F-{X → Y}) U {(X – {A}) → Y} is equivalent to F then replace X → Y with (X – {A}) → Y in F; 4.Eliminate redundant FDs: For each remaining FD X → Y in F if (F – {X → Y}) is equivalent to F then remove X → Y from F

Decomposition Algorithm for BCNF Can always find a lossless decomposition that is BCNF –Find a FD that is a violation of BCNF and remove it by decomposition process –Repeat this process until all violations are removed No need to go through 1NF, 2NF, 3NF process Not always possible to preserve all FDs

Synthesis Algorithm for 3NF Can always find 3NF decomposition that is lossless and that preserves all FDs 3NF Algorithm uses synthesis –Begin with universal relation and set of FDs,G –Find a minimal cover for G –Combine FDs that have the same determinant –Include a relation with a key of R –Algorithm in the book, p. 260