Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jennifer Widom Relational Design Theory Functional Dependencies.

Similar presentations


Presentation on theme: "Jennifer Widom Relational Design Theory Functional Dependencies."— Presentation transcript:

1 Jennifer Widom Relational Design Theory Functional Dependencies

2 Jennifer Widom Relational design by decomposition  “Mega” relations + properties of the data  System decomposes based on properties  Final set of relations satisfies normal form – No anomalies, no lost information  Functional dependencies  Boyce-Codd Normal Form  Multivalued dependences  Fourth Normal Form Functional dependencies are generally useful concept  Data storage – compression  Reasoning about queries – optimization Functional Dependencies

3 Jennifer Widom Example: College application info. Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) Apply(SSN, cName, state, date, major) Functional Dependencies

4 Jennifer Widom Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) Suppose priority is determined by GPA Two tuples with same GPA have same priority Functional Dependencies

5 Jennifer Widom Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) Two tuples with same GPA have same priority Functional Dependencies

6 Jennifer Widom Functional Dependency  Based on knowledge of real world  All instances of relation must adhere Functional Dependencies

7 Jennifer Widom Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) Functional Dependencies

8 Jennifer Widom Apply(SSN, cName, state, date, major) Functional Dependencies

9 Jennifer Widom Functional Dependencies and Keys  Relation with no duplicates  Suppose Ᾱ  all attributes Functional Dependencies

10 Jennifer Widom Trivial Functional Dependency Nontrivial FD Completely nontrivial FD Functional Dependencies

11 Jennifer Widom Rules for Functional Dependencies Splitting rule Can we also split left-hand-side? Functional Dependencies

12 Jennifer Widom Rules for Functional Dependencies Combining rule Functional Dependencies

13 Jennifer Widom Rules for Functional Dependencies Trivial-dependency rules Functional Dependencies

14 Jennifer Widom Rules for Functional Dependencies Transitive rule Functional Dependencies

15 Jennifer Widom Closure of Attributes  Given relation, FDs, set of attributes Ᾱ  Find all B such that Ᾱ  B Functional Dependencies

16 Jennifer Widom Closure Example Student(SSN, sName, address, HScode, HSname, HScity, GPA, priority) SSN  sName, address, GPA GPA  priority HScode  HSname, HScity Functional Dependencies

17 Jennifer Widom Closure and Keys Is Ᾱ a key for R ? How can we find all keys given a set of FDs? Functional Dependencies

18 Jennifer Widom Specifying FDs for a relation  S 1 and S 2 sets of FDs  S 2 “follows from” S 1 if every relation instance satisfying S 1 also satisfies S 2 How to test? Does A  B follow from S ? Functional Dependencies

19 Jennifer Widom Specifying FDs for a relation Want: Minimal set of completely nontrivial FDs such that all FDs that hold on the relation follow from the dependencies in this set Functional Dependencies

20 Jennifer Widom Functional dependencies are generally useful concept  Relational design by decomposition Functional dependencies  Boyce-Codd Normal Form  Data storage – compression  Reasoning about queries – optimization Functional Dependencies


Download ppt "Jennifer Widom Relational Design Theory Functional Dependencies."

Similar presentations


Ads by Google