Download presentation

Presentation is loading. Please wait.

Published byAdrian Billow Modified about 1 year ago

1
Chapter Three Functional Dependency Objectives: -Characteristics of a good design -Functional dependency -Converting an ER model to relational model

2
2 What is Good design? Faculty Name IDYear Exper. Dep. Name No. Facul. No. Students F1112Cosc3141 F2125Cosc3141 F3131Math155 F4143Cosc??

3
3 What is Good design? (Continued) Repeat of Info. Waste of space Update problem Loss of Info. Dept. with one faculty? What happens to the students in that dept if faculty leaves. Unable to represent Info. Dept with no faculty? Redundancy, Inconsistency, ….

4
4 What is Good design? (Continued) DeptDept Name Num FacultyNum Students Cosc3141 Math155

5
5 What is Good design? (Continued) FacultyFaculty Name IDYear Exper. Dept. Name F1I12Cosc F2I25Cosc F3I31Math F4143Cosc

6
6 What is the primary key? R (A, B, C, D) R(ABCD ) a1b1c1d1 a1b2c1d2 a2b2c2d2 a2b3c2d3 a3b3c2d4 A ---> B A ---> C A ---> D AB ---> C CB ---> A AB ---> D CB ---> D ABC--> D ACD --> B

7
7 Functional Dependency (FD): R (Pilot, Flight, Date, Time_Depart) Restrictions: For each flight there is exactly one Time_Depart For any given pilot, Date, Time_Depart there is only one Flight For a given Flight, Date, there is only one Pilot

8
8 Informal Definition of FD: Values of Tuple(s) on a set of attributes uniquely determines the value of another set of attributes

9
9 Informal Definition of FD: (Continued) FD: 1. Time_Depart FD on Flight 2. Flight FD on {Pilot, Date, Time_Depart} 3. Pilot FD on {Flight, Date} FD: 1. Flight ---> Time_depart 2. Pilot, Date, Time_Depart ---> Flight 3. Flight, Date ---> Pilot

10
10 Informal Definition of FD: (Continued) So… Given the FD, we know the Extension Example: 1. Name ---> Address NameAddress N1A1 N2A1 N3A2

11
11 Informal Definition of FD: (Continued) 3. Name ---> Address NameAddress Address ---> Name N1A1 N2A2 N3A3 2. Address ---> Name A1N1 A2N3

12
12 Functional Dependency (FD) Example: For every student there exists one advisor. Student ---> Advisor Example: R(A,B,C …)FD: A ---> B R ( AB ) a1b1 a1?

13
13 Functional Dependency (FD) (Continued) Students (Name, ID, GPA) ID ---> Name ID ---> GPA

14
14 Functional Dependency (FD) (Continued) R(Pilot, Flight, Date, Time_Depart) Flight ---> Time_Depart Pilot, Date, Time_Depart ---> Flight Flight, Date ---> Pilot PilotFlightDateTime_Depart John4501/14:00 John4503/14:00 Mary4502/14:00 Mary4504/14:00 Larry4603/16:00

15
15 Facts: The set of FD is dependent on semantic knowledge There are a finite set of FD So…It is possible to find all FD To find all FD is lengthy, so we use Armstrong Axiom (Inference Axiom)

16
16 Armstrong Axiom (Inference Axiom) If a relation satisfies certain FD It must satisfy other FD 1.Reflexivity: X ---> X 2.Augmentation: X ---> y Implies xz ---> y

17
17 Armstrong Axiom (Inference Axiom) 3.Additivity: x ---> y x ---> z Then x ---> zy 4.Pseudotransitivity: x ---> y yz ---> w Then xz ---> w

18
18 Armstrong Axiom (Inference Axiom) 5.Transitivity: x ---> y y ---> z Then x ---> z 6.Projectivity (Reveres of additivity) x ---> yz Then x ---> y

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google