Module 4
Module 4
Navathe
CHAPTER 14
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.
GUIDELINE 4:
The relations should be designed to satisfy the
lossless join condition.
No spurious tuples should be generated by doing
a natural-join of any relations.
Note that:
Property (a) is extremely important and cannot be
sacrificed.
Property (b) is less stringent and may be sacrificed. (See
Chapter 15).
Normal form:
Condition using keys and FDs of a relation to
certify whether a relation schema is in a particular
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.
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.
D3: {instructor, course } and {instructor, student}
All three decompositions will lose fd1.
We have to settle for sacrificing the functional dependency
Instructor Student.
Since Instructor Course is indeed true, the NJB
property is satisfied and D3 is determined as a non-
additive (good) decomposition.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 14- 65
General Procedure for achieving BCNF
when a relation fails BCNF
Here we make use the algorithm from Chapter
15 (Algorithm 15.5):
Let R be the relation not in BCNF, let X be a subset-of R,
and let X A be the FD that causes a violation of BCNF.
Then R may be decomposed into two relations:
(i) R –A and (ii) X υ A.
If either R –A or X υ A. is not in BCNF, repeat the
process.
Note that the f.d. that violated BCNF in TEACH was Instructor Course.
Hence its BCNF decomposition would be :
(TEACH – COURSE) and (Instructor υ Course), which gives
the relations: (Instructor, Student) and (Instructor, Course) that
we obtained before in decomposition D3.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 14-55
5. Multivalued Dependencies and Fourth
Normal Form (1)
Definition:
A multivalued dependency (MVD) X —>> Y specified on relation
schema R, where X and Y are both subsets of R, specifies the
following constraint on any relation state r of R: If two tuples t1 and
t2 exist in r such that t1[X] = t2[X], then two tuples t3 and t4 should
also exist in r with the following properties, where we use Z to
denote (R 2 (X υ Y)):
t3[X] = t4[X] = t1[X] = t2[X].
t3[Y] = t1[Y] and t4[Y] = t2[Y].
t3[Z] = t2[Z] and t4[Z] = t1[Z].
An MVD X —>> Y in R is called a trivial MVD if (a) Y is a subset of
X, or (b) X υ Y = R.
Figure 14.15
Fourth and fifth normal forms. (a) The EMP relation with two MVDs: Ename –>> Pname and Ename –>>
Dname. (b) Decomposing the EMP relation into two 4NF relations EMP_PROJECTS and EMP_DEPENDENTS. (c)
The relation SUPPLY with no MVDs is in 4NF but not in 5NF if it has the JD(R1, R2, R3). (d) Decomposing the
relation SUPPLY into the 5NF relations R1, R2, R3.