CP 224 LECT - 2 - 2 - Relational Database Design
CP 224 LECT - 2 - 2 - Relational Database Design
Design
Features of Good Relational Design
Atomic Domain and First Normal Form
Function Dependency and Inferencing
Normalization
Functional Dependency Theory
Closure of a Set of Functional Dependencies
Lossless join decomposition
Algorithms for Functional Dependencies
Decomposition Algorithms Using Functional
Dependencies
Decomposition Using Multivalued Dependencies
Database-Design Process
Modeling Temporal Data
Decomposition Using Functional
Dependencies
Let R be a relation schema
R and R
The functional dependency
holds on R if and only if for any legal relations r(R),whenever
any two tuples t1 and t2 of r agree on the attributes , they also
agree on the attributes .
Example: Consider R(A,B, C, D ) with the following instance of
r.
R = (A, B, C, G, H, I)
F={A→B
A→C
CG → H
CG → I
B → H}
some members of F+
A→H
by transitivity from A → B and B → H
AG → I
by augmenting A → C with G, to get AG → CG and then
transitivity with CG → I
CG → HI
by augmenting CG → I to infer CG → CGI,
result := ;
while (changes to result) do
for each in F do
begin
if result then result := result
end
Computing closure of F
For each γ R, we find the closure γ+, and for each S γ+
we output a functional dependency γ → S.
Canonical Cover
Sets of functional dependencies may have redundant
dependencies that can be inferred from the others
For example: A C is redundant in: {A B, B C,
A C}
Parts of a functional dependency may be redundant
E.g.: on RHS: {A B, B C, A CD} can be
simplified to
{ A B , B C, A D}
E.g.: on LHS: {A B, B C, AC D} can be
simplified to
{A B, B C, A D}
Example: Given F = {A C, AB C }
B is extraneous in AB C because {A C, AB C} logically
implies A C (I.e. the result of dropping B from AB C).
Example
R = (A, B, C )
F = {A → B
B → C}
Key = {A}
R is not in BCNF