04.06.2015 Views

Database Modeling and Design

Database Modeling and Design

Database Modeling and Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.5 Fourth <strong>and</strong> Fifth Normal Forms 135<br />

posed into three tables, A->B, A->C, <strong>and</strong> A->D, all based on the same<br />

superkey A; however, it is already in 5NF without the decomposition.<br />

Thus, the decomposition is not required for normalization. On the other<br />

h<strong>and</strong>, decomposition can be a useful tool in some instances for performance<br />

improvement.<br />

The following example demonstrates that a table representing a ternary<br />

relationship may not have any two-way lossless decompositions;<br />

however, it may have a three-way lossless decomposition, which is<br />

equivalent to three binary relationships, based on the three possible projections<br />

of this table. This situation occurs in the relationship skill-incommon<br />

(Figure 6.6), which is defined as “The employee must apply the<br />

intersection of his or her available skills with the skills needed to work<br />

on certain projects.” In this example, skill-in-common is less restrictive<br />

than skill-required because it allows an employee to work on a project<br />

even if he or she does not have all the skills required for that project.<br />

As Table 6.6 shows, the three projections of skill_in_common<br />

result in a three-way lossless decomposition. There are no two-way lossless<br />

decompositions <strong>and</strong> no MVDs; thus, the table skill_in_common is<br />

in 4NF.<br />

The ternary relationship in Figure 6.6 can be interpreted yet another<br />

way. The meaning of the relationship skill-used is “We can selectively<br />

record different skills that each employee applies to working on individual<br />

projects.” It is equivalent to a table in 5NF that cannot be decomposed<br />

into either two or three binary tables. Note by studying Table 6.7<br />

that the associated table, skill_used, has no MVDs or JDs.<br />

Table 6.7<br />

The Table skill_used, Its Three Projections, <strong>and</strong> Natural Joins of<br />

Its Projections<br />

skill_used emp_id proj_no skill_type<br />

101 3 A<br />

101 3 B<br />

101 4 A<br />

101 4 C<br />

102 3 A<br />

102 3 B<br />

102 4 A<br />

102 4 B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!