How to test Whether Subschemes in BCNF??

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Schema Refinement: Canonical/minimal Covers
Functional Dependencies- Examples
Functional Dependencies- Examples
CS 440 Database Management Systems Practice problems for normalization.
1 Design Theory. 2 Minimal Sets of Dependancies A set of dependencies is minimal if: 1.Every right side is a single attribute 2.For no X  A in F and.
Properties of Armstrong’s Axioms Soundness All dependencies generated by the Axioms are correct Completeness Repeatedly applying these rules can generate.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 227 Database Systems I Design Theory for Relational Databases.
CS Algorithm : Decomposition into 3NF  Obviously, the algorithm for lossless join decomp into BCNF can be used to obtain a lossless join decomp.
1 Design Theory. 2 Let U be a set of attributes and F be a set of functional dependencies on U. Suppose that X  U is a set of attributes. Definition:
Classroom Exercise: Normalization
Relational Design. DatabaseDesign Process Conceptual Modeling -- ER diagrams ER schema transformed to relational schema Designer may add additional integrity.
FDImplication: 1 Functional Dependencies (FDs) Let r(R) be a relation and let t  r, then the restriction of t to X  R, written t[X], is the projection.
Design Theory.
The principal problem that we encounter is redundancy, where a fact is repeated in more than one tuple. Most common cause: attempts to group into one relation.
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Decomposition By Yuhung Chen CS157A Section 2 October
1 Triggers: Correction. 2 Mutating Tables (Explanation) The problems with mutating tables are mainly with FOR EACH ROW triggers STATEMENT triggers can.
A BC D Let ABCD be a quadrilateral. Join AC. Clearly, ∠ 1 + ∠ 2 = ∠ A (i) And, ∠ 3 + ∠ 4 = ∠ C (ii) We know that the sum of the angles.
THIRD NORMAL FORM (3NF) A relation R is in BCNF if whenever a FD XA holds in R, one of the following statements is true: XA is a trivial FD, or X is.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
Section 3 CSE 444 Introduction to Databases. Announcements Project 1 was due yesterday (10/14/2009) Homework 1 was released, due 10/28/2009.
Functional Dependencies CIS 4301 Lecture Notes Lecture 8 - 2/7/2006.
Multivalued Dependencies and 4th NF CIS 4301 Lecture Notes Lecture /21/2006.
© 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.
1 Lecture 9: Database Design Wednesday, January 25, 2006.
Case tool Relational Database Schema Designer Cai Xinlei Tang Ning Xu Chen Zhang Yichuan CS4221 P06.
Functional Dependencies and Normalization 1 Instructor: Mohamed Eltabakh Part 2.
Problem G-1 Schyler Fennimore.
Design Theory for Relational Databases
CS 440 Database Management Systems
CS422 Principles of Database Systems Normalization
Schedule Today: Next After that Normal Forms. Section 3.6.
Relational Database Design (Discussion Session)
Schema Refinement and Normal Forms
Functional Dependency
Normalization First Normal Form (1NF) Boyce-Codd Normal Form (BCNF)
CS422 Principles of Database Systems Normalization
Canonical Cover & Normal Forms
CS 480: Database Systems Lecture 22 March 6, 2013.
3.1 Functional Dependencies
Dependency Preservation
تصنيف التفاعلات الكيميائية
Functional Dependencies and Normalization
Canonical Cover & Normal Forms
Lecture 6: Design Theory
Functional Dependencies and Normalization
Functional Dependencies and Normalization
Cse 344 May 16th – Normalization.
Introduction to Database Systems CSE 444 Lectures 8 & 9 Database Design October 12 & 15, 2007.
Relational Data Base Design in Practice
Normalization Part II cs3431.
CPSC-310 Database Systems
Lecture 8: Database Design
Functional Dependencies
Lecture 19a The Chase Test for Lossless Join
Lecture 07: E/R Diagrams and Functional Dependencies
Normalization cs3431.
Some slides are from Dr. Sara Cohen
Instructor: Mohamed Eltabakh
Relational Database Design
Functional Dependencies
Computing Closure of F We could test for whether a relation scheme is in BCNF, if we could compute the closure of F. Closure of F can be computed using.
Instructor: Mohamed Eltabakh
Third Normal Form.
Quiz 2 Let R(A,B,C,D) be a relation schema with
Lecture 6: Functional Dependencies
Functional Dependencies and Normalization
CS4222 Principles of Database System
Presentation transcript:

How to test Whether Subschemes in BCNF?? Let S be a subscheme of R. To test whether S is in BCNF, we need to test whether for each fd X --> Y that holds in S, X is a superkey of S. However, this means we need to figure out the set of functional dependencies that hold on S. Algorithm to compute the set of FD’s that hold on S For each X that is a subset of S Do /* note that this is in general exponential*/ Compute X+ For each attribute B s.t. B is in S B is in X+ B is not in X the functional dependency X ---> B holds in S

Example (1) Let R have a schema R(A,B,C,D) S have a schema S(A,C) FD over R be A --> B and B --> C Compute A+ == {A,B,C} hence dependencies A --> C holds in S Compute C+ == {C} no new dependency gets added. Compute {AC}+ == {ABC} since {AC}+ is the same as {A}+, no new dependecy gets added. In general you can limit search as follows: it is not necc. To consider the closure of the set of all S’s attributes For example, {AC}+ need not have been considered in the above example Not necc. To consider a set of attributes that does not contain the lhs of any dependecy. {C}+ need not have been considered in the above example Not necc. To consider a set that contains an attribute that is not in the lhs of any functional dependency {AC}+ need not have been considered in the above example.

Example (2) Consider R(A,B,C,D,E) and S(A,B,C) FD on R be A -->D, B ---> E, DE --> C Compute {A}+ == {A,D} no dependency gets added. Compute {B}+ == {BE} no dependency gets added {C}+ does not need to be considered since {C} not in lhs of any dep. Compute {AB}+ == {A,B,C,D,E} add dependency AB -->C {AC}+ and {BC}+ do not need to be considered since {C} not in lhs of any dep. Since {AB}+ == all attributes in R, {ABC} need not be considered. Hence, the only dep. On S is AB ---> C