CSE311 - IAH - Slide09 - Normalization - Compatibility Mode
CSE311 - IAH - Slide09 - Normalization - Compatibility Mode
Navathe
CHAPTER 14
Chapter Outline
n 3 Normal Forms Based on Primary Keys
n 3.1 Normalization of Relations
n 3.2 Practical Use of Normal Forms
n 3.3 Definitions of Keys and Attributes Participating in Keys
n 3.4 First Normal Form
n 3.5 Second Normal Form
n 3.6 Third Normal Form
Figure 14.1 A
simplified COMPANY
relational database
schema.
Figure 14.3
Two relation schemas
suffering from update
anomalies. (a)
EMP_DEPT and (b)
EMP_PROJ.
n GUIDELINE 2:
n Design a schema that does not suffer from the
insertion, deletion and update anomalies.
n If there are any anomalies present, then note them
so that applications can be made to take them into
account.
n GUIDELINE 3:
n Relations should be designed such that their
tuples will have as few NULL values as possible
n Attributes that are NULL frequently could be
placed in separate relations (with the primary key)
n Reasons for nulls:
n Attribute not applicable or invalid
n Attribute value unknown (may exist)
n Value known to exist, but unavailable
n GUIDELINE 4:
n The relations should be designed to satisfy the
lossless join condition.
n No spurious tuples should be generated by doing
a natural-join of any relations.
n Note that:
n Property (a) is extremely important and cannot be
sacrificed.
n Property (b) is less stringent and may be sacrificed. (See
Chapter 15).
2. Functional Dependencies
n Normalization:
n The process of decomposing unsatisfactory "bad"
relations by breaking up their attributes into
smaller relations
n Normal form:
n Condition using keys and FDs of a relation to
certify whether a relation schema is in a particular
normal form
n Disallows
n composite attributes
n multivalued attributes
n nested relations; attributes whose values for an
individual tuple are non-atomic
n Considered to be part of the definition of a
relation
n Most RDBMSs allow only those relations to be
defined that are in First Normal Form
Figure 14.10
Normalizing nested relations into 1NF. (a) Schema of the EMP_PROJ relation with a
nested relation attribute PROJS. (b) Sample extension of the EMP_PROJ relation
showing nested relations within each tuple. (c) Decomposition of EMP_PROJ into
relations EMP_PROJ1 and EMP_PROJ2 by propagating the primary key.
n Definition:
n Superkey of relation schema R - a set of attributes
S of R that contains a key of R
n A relation schema R is in third normal form (3NF)
if whenever a FD X → A holds in R, then either:
n (a) X is a superkey of R, or
n (b) A is a prime attribute of R
n LOTS1 relation violates 3NF because
Area → Price ; and Area is not a superkey in
LOTS1. (see Figure 14.12).
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 14- 45
Figure 14.13
Boyce-Codd normal form. (a) BCNF normalization of
LOTS1A with the functional dependency FD2 being lost in
the decomposition. (b) A schematic relation with FDs; it is
in 3NF, but not in BCNF due to the f.d. C → B.
Figure 14.14
A relation TEACH that is in 3NF
but not BCNF.
Chapter Summary