DBMS 3
DBMS 3
UNIT – III
SCHEMA REFINEMENT
NORMAL FORMS
UNIT – III
8
SCHEMA REFINEMENT
Introduction to schema refinement
Functional dependencies
Reasoning about FDs
NORMAL FORMS
1NF, 2NF, 3NF, BCNF
Properties of decompositions, normalization,
schema refinement in database design
Other kinds of dependencies: 4NF, 5NF, DKNF
Case studies
The Evils of Redundancy
9
5 7
Use of Decomposition (cont.)
14
231-31-5368 Smiley 22 8 30
131-24-3650 Smethurst 35 5 30
434-26-3751 Guldu 35 5 32
612-67-4134 Madayan 35 8 40
Problems related to Decomposition
15
i.e., given two tuples in r, if the X values agree, then the Y values
must also agree. (X and Y are sets of attributes.)
An FD is a statement about all allowable relations.
Must be identified based on semantics of application.
An FD X →Y where Y ⊆ X
-called a trivial FD, it always holds good
An FD X →Y where Y ⊈ X
-non-trivial FD
An FD X →Y where X ∩Y = Ø
-completely non-trivial FD
FUNCTIONAL DEPENDENCIES (FDs) cont.
19
Problems due to R → W :
S N L R H
123-22-3666 Attishoo 48 8 40
Update anomaly: Can
we change W in just 231-31-5368 Smiley 22 8 30
the 1st tuple of 131-24-3650 Smethurst 35 5 30
SNLRWH? 434-26-3751 Guldu 35 5 32
Insertion anomaly: What
612-67-4134 Madayan 35 8 40
if we want to insert an
employee and don’t know S N L R W H
the hourly wage for his 123-22-3666 Attishoo 48 8 10 40
rating?
231-31-5368 Smiley 22 8 10 30
Deletion anomaly: If we
delete all employees with 131-24-3650 Smethurst 35 5 7 30
rating 5, we lose the 434-26-3751 Guldu 35 5 7 32
information about the 612-67-4134 Madayan 35 8 10 40
wage for rating 5!
Constraints on a Relationship Set
21
Check if Y is in X +
Does F = {A → B, B → C, C D →E } imply A → E?
i.e, is A → E in the closure F + ? Equivalently, is E in A+ ?
Closure of a Set of FDs
25
The set of all FDs implied by a given set F of FDs is called the
closure of F and is denoted as F+.
Reflexive Rule:
F ⊨{X →Y | Y ⊆ X} for any X. Trivial FDs
Augmentation Rule:
{X →Y} ⊨ {XZ →YZ}, Z ⊆ R. Here XZ denotes X ⋃ ⋃Z
Transitive Rule:
{X →Y, Y →Z} ⊨ {X →Z}
Armstrong's Axioms are sound in that they generate only FDs in F+
when applied to a set F of FDs.
They are complete in that repeated application of these rules will
generate all FDs in the closure F+.
Closure of a Set of FDs (or Armstrong’s Inference Rules)
27