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:

Slides:



Advertisements
Similar presentations
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
Logical Database Design (3 of 3) John Ortiz. Lecture 7Logical Database Design (2)2 Normalization  If a relation is not in BCNF or 3NF, we refine it by.
Manipulating Functional Dependencies Zaki Malik September 30, 2008.
1 Conjunctions of Queries. 2 Conjunctive Queries A conjunctive query is a single Datalog rule with only non-negated atoms in the body. (Note: No negated.
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.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
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.
CS 355 – Programming Languages
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Discussion #36 Spanning Trees
מבנה המחשב + מבוא למחשבים ספרתיים תרגול 1#
Design Theory.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
Proving correctness. Proof based on loop invariants  an assertion which is satisfied before each iteration of a loop  At termination the loop invariant.
1 Triggers: Correction. 2 Mutating Tables (Explanation) The problems with mutating tables are mainly with FOR EACH ROW triggers STATEMENT triggers can.
Mathematical Induction
Functional Dependencies Prof. Yin-Fu Huang CSIE, NYUST Chapter 11.
Linear Algebra Chapter 4 Vector Spaces.
Reading and Writing Mathematical Proofs
MS 101: Algorithms Instructor Neelima Gupta
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
The Binomial Theorem Lecture 29 Section 6.7 Mon, Apr 3, 2006.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
1 Lecture 6: Schema refinement: Functional dependencies
Prof. Busch - LSU1 NFAs accept the Regular Languages.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
CompSci 102 Discrete Math for Computer Science
Complexity and Computability Theory I Lecture #2 Rina Zviel-Girshin Leah Epstein Winter
Chapter 2 With Question/Answer Animations. Section 2.1.
Math 344 Winter 07 Group Theory Part 1: Basic definitions and Theorems.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
October 3, 2001CSE 373, Autumn Mathematical Background Exponents X A X B = X A+B X A / X B = X A-B (X A ) B = X AB X N +X N = 2X N 2 N +2 N = 2 N+1.
1/32 This Lecture Substitution model An example using the substitution model Designing recursive procedures Designing iterative procedures Proving that.
Functional Dependencies CIS 4301 Lecture Notes Lecture 8 - 2/7/2006.
MIS 3053 Database Design And Applications The University Of Tulsa Professor: Akhilesh Bajaj Normal Forms Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
CS542 1 Schema Refinement Chapter 19 (part 1) Functional Dependencies.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Induction Practice CS1050. Prove that whenever n is a positive integer. Proof: Basis Case: Let n = 1, then.
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.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Example 2 You are traveling by a canoe down a river and there are n trading posts along the way. Before starting your journey, you are given for each 1
Lecture 34 Section 6.7 Wed, Mar 28, 2007
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2012
Problem Axiom of addition:
The Closure of a set of Attributes
CSE 311: Foundations of Computing
Math 344 Winter 07 Group Theory Part 1: Basic definitions and Theorems
تصنيف التفاعلات الكيميائية
How to test Whether Subschemes in BCNF??
Decomposition of relational schemes
Functional Dependencies
Normalization cs3431.
Some slides are from Dr. Sara Cohen
Induction (Section 3.3).
Chapter 19 (part 1) Functional Dependencies
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.
This Lecture Substitution model
Relational Database Design Theory
Relational Database Theory
Presentation transcript:

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: X + = { A | F X  A} We would like to compute X + Note: We use the symbol, not the symbol. Is there a difference? Closure of a Set of Attributes |=|= |=|= |_|_

3 Algorithm From Class Compute Closure(X, F) 1.X + := X 2.While there if a V  W in F such that V  X + W  X + X + := X +  W 3. Return X + Complexity: |U|*|F|

4 A More Efficient Algorithm We start by creating a table, with a row for each FD and a column for each attribute. The table will have 2 additional columns called size and tail. In the row for a dependency X  Y, there will be the value true in each column corresponding to an attribute in X. The size column will contain the size of the set X. The tail column will contain Y.

5 Example Table F = {A → C, B → D, AD → E} ABCDESizeTail A → C 1 C B → D 1 D AD → E 2 E

6 Compute Closure(X, F, T) /* T is the table */ X + := X Q := X While Q is not empty A := Q.dequeue() for i=1..|F| if T[i, A]=true then T[i,size] := T[i, size] –1 if T[i,size]=0, then –X + := X +  T[i,tail] –Q := Q  T[i,tail]

7 Computing AB + ABCDESizeTail A → C 1 C B → D 1 D AD → E 2 E Start: X + = {A,B}, Q = {A, B}

8 Computing AB + ABCDESizeTail A → C 0 C B → D 1 D AD → E 1 E Iteration of A: X + = {A,B,C}, Q = {B,C}

9 Computing AB + ABCDESizeTail A → C 0 C B → D 0 D AD → E 1 E Iteration of B: X + = {A,B,C,D}, Q = {C,D}

10 Computing AB + ABCDESizeTail A → C 0 C B → D 0 D AD → E 1 E Iteration of C: X + = {A,B,C,D}, Q = {D}

11 Computing AB + ABCDESizeTail A → C 0 C B → D 0 D AD → E 0 E Iteration of D: X + = {A,B,C,D,E}, Q = {E}

12 Computing AB + ABCDESizeTail A → C 0 C B → D 0 D AD → E 0 E Iteration of E: X + = {A,B,C,D,E}, Q = {}

13 Complexity? To get an efficient algorithm, we assume that there are pointers from each “true” box in the table to the next “true” box in the same column. ABCDESizeTail A → C 1 C B → D 1 D AD → E 2 E

14 Complexity The complexity of the algorithm is |F| using the pointers We have to prove that the algorithm is sound. We also have to prove it is complete. There are 2 different ways: –Show that if F X  A, then A is in the set returned by the algorithm |=|= |_|_

15 Proof of Correctness We will prove that the algorithm from the class is sound and complete. The more efficient algorithm here clearly computes the same set. We use X (j) to denote the value in X + at the end of the j-th iteration of the while loop.

16 Soundness We will show by induction on j that if A is in X (j), then F X  A, using Armstrong’s axioms Basis (j=0): Then A is in X, so by reflectivity, F X  A Induction: Suppose X (j-1), only contains attributes B such that F X  B. Suppose that A is added to X (j) because of a dependency V  W in F. Then, V  X (j-1) and A is in W. Then, F X  V. Thus, F X  W and F X  A. |_|_ |_|_ |_|_ |_|_ |_|_ |_|_

17 Completeness This can be shown in the same manner that we proved the completeness of Armstrong’s axioms. Formally, we show that if A is not in X +, computed by the algorithm, then there is a relation instance in which all of F hold, but X  A does not hold.