Chapter 4 Part 2 - B: Logical Database Design & The Relational Model
Chapter 4 Part 2 - B: Logical Database Design & The Relational Model
1NF
2NF
Theme? Theme?
Not
always
exist
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-19
PARTIAL, TRANSITIVE, AND FULL FUNCTIONAL
DEPENDENCIES
Partial: Note the PK here has TWO PARTS
Transitive: Like skipping a stone
Repeat
Attributes in Attributes in
Attributes in 3rd theme
1st theme 2nd theme
1
3
A B C D E F
1 A B F
2 A C D
3 B E
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-31
Print 4-32 and 4-33 on ONE sheet of paper helps to visualize
Figure 4-27 Functional dependency diagram for INVOICE
A C D
Solution (p186): Non-key determinant (“c”here) with
transitive dependencies go into a new relation; non-
key determinant becomes primary key in the new
table and stays as foreign key in the old table
Dependents are REMOVED from the old relation
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-34
35
Print 4-33 and 4-34 on ONE sheet of paper helps to visualize
Figure 4-29 Removing partial dependencies
Old relation
Getting it into
Third Normal
Form
New relation
A B E F
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-36
PARTIAL VS TRANSITIVE DEPENDENCY
Transitive: Key determines non-key-1, and non-
key-1 determines non-key-2
“You are NOT a key! So you can’t determine
others!”
A (key) c (non-key-1) d (non-key-2)
2
A B C D E F G H
3
1: _________________________ dependency?
2: _________________________ dependency?
3: _________________________ dependency?
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-38
PARTIAL VS TRANSITIVE - NORMALIZED 39
2
A B C D E F 2NF
1
A B F B 2 E
A C D
A C C D
3
3
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-39
PARTIAL VS TRANSITIVE DEPENDENCY
1
There is ALWAYS a
________ dependency;
A B C D E There may or may not be
_______ or ___________
dependencies.
3
1: _________________________ dependency?
3: _________________________ dependency?
A B C D E F G H
A B C D E F G H K
[A+B] G, H - ?
B C - ? Types?
A D, E, F - ?
D E - ?
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-42
ANATOMY OF FUNCTIONAL DEPENDENCIES (2)
A B C D E F G H K
A B C D E F G H
A: 1 arrow out
B: 1 arrow in, 1 arrow out
D: 1 arrow in, 1 arrow out
C: 2 arrows in
E: 2 arrows in
Chapter 4 Copyright © 2016 Pearson Education, Inc. 4-44
45
A A A1 A2 A3 A4 B1
B B1 B2 B3 B4 B5
B
B B1 B2 B3 A1 A4
b) Sample
data with
enterprise
key