Functional Dependencies

6
Functional Dependencies Alternative Data Modeling Approach Based on Formal Logic ER Diagrams can be mapped into FDs (sans some cardinality information) Algorithms to automatically generate 3 rd Normal form. FDs (alone with MVDs and JDs) are used to formally define the various relational normal forms (e.g., 3 rd normal form).

description

Functional Dependencies. Alternative Data Modeling Approach Based on Formal Logic ER Diagrams can be mapped into FDs (sans some cardinality information) Algorithms to automatically generate 3 rd Normal form. - PowerPoint PPT Presentation

Transcript of Functional Dependencies

Page 1: Functional Dependencies

Functional Dependencies

• Alternative Data Modeling Approach• Based on Formal Logic• ER Diagrams can be mapped into FDs

– (sans some cardinality information)

• Algorithms to automatically generate 3rd Normal form.

• FDs (alone with MVDs and JDs) are used to formally define the various relational normal forms (e.g., 3rd normal form).

Page 2: Functional Dependencies

Functional Dependencies

Attribute(s) B are said to be functionally dependent on attribute(s) A iff (if and only if) for all valid instance(s) of A, those values of A uniquely determine the value(s) for B.

P# Color P#,S# Qty P# > PN

Page 3: Functional Dependencies

Employee(EmpID,Name,Dept,Salary,Course,Date Completed)

• FDs:– EMPID Name,Dept,Salary– Course date completed

• Note: A key is a set of non-redundant attributes that functionally determines all the attributes in the relation schema.

• empid,course name,dept,salary,date completed

Page 4: Functional Dependencies

Functional Dependency Rules

• Augmentation: if x Y, then ZX Y– Student# StudentName then

Student # course # student name

• Transitivity:if X Y & Y Z then X Z– Student # major and major advisor then

student# advisor

• Pseudo Transitivity: if X Y & YZ W then XZ W Thus if student # major and major, class advisor then student #,Class advisor

Page 5: Functional Dependencies

If X,Y,Z, and W are attributes:

• X X (reflexive)

• If X y then XZ Y (augmentation)

• If X Y & X Z then X YZ (union)

• If X Y then X Z where Z subset of Y (Decomposition)

• IF X Y & Y Z then X Z (transitivity)

• IF X Y & YZ W, then XZ W

(pseudotransitivity)

Page 6: Functional Dependencies

Suppose relation (A B C D) with A BC, B D, and DB A

• Are These Valid Derivations?– A B A D A BD– A A A C B A

• Is this a “Minimal” equivalent Set?– B A– A CD