FIFTH NORMAL FORM

Now, when we were talking about FDs and BCNF, we got into a discussion of trivial FDs and FD irreducibility and FDs implied by keys and various related matters. As I’m sure you’d expect by now, analogous concepts arise in connection with JDs and 5NF also—but the details are a little trickier. Well, the concept of a JD being trivial is actually quite straightforward:

  • Definition: Let {X1,...,Xn} be a JD, J say, with respect to heading H. Then J is trivial if and only if it’s satisfied by every relation with heading H.

From this definition, it’s easy to prove the following result:

  • Theorem: Let {X1,...,Xn} be a JD, J say, with respect to heading H. Then J is trivial if and only if some Xi (1 ≤ in) is equal to H (because every relation with heading H necessarily satisfies every JD with respect to H that’s of the form {...,H,...}).

We can regard this theorem as an operational (or “syntactic”) definition, inasmuch as it provides an effective test that can easily be applied in practice. (By contrast, the formal or “semantic” definition isn’t much use in the practical problem of determining whether or not a given JD is trivial.)

I’ll defer discussion of JD irreducibility to the next chapter; before then I want to explain what it means for a JD to be implied by keys.

  • Definition: Let relvar R have heading H and let {X1,...,Xn} be a JD, J say, with respect to H. Then J is implied by the keys of R if and only if every relation r that satisfies R’s key constraints also satisfies J.

This definition requires some elaboration. First of all, to say some relation satisfies some key constraint is to say it satisfies the applicable uniqueness requirement; and if it satisfies the uniqueness requirement for the attributes that constitute some key, it certainly satisfies the uniqueness requirement for every superset of that set of attributes (just so long as that superset is a subset of the pertinent heading, of course)—in other words, for every corresponding superkey. Thus, the phrase “satisfies R’s key constraints” in the definition could be replaced by the phrase “satisfies R’s superkey constraints” without making any significant difference. Likewise, the concept “implied by keys” could just as well be “implied by superkeys,” again without making any significant difference.

Second, what happens if the JD J mentioned in the definition is trivial? Well, in that case, by definition, J is satisfied by every relation r with heading H, and so J is certainly satisfied by every relation r that satisfies R’s key constraints a fortiori. So trivial JDs are always “implied by keys,” trivially.

Third, then, suppose J is nontrivial. How do we determine whether some nontrivial JD is implied by the keys of some relvar? This question does have a satisfactory answer, but it’s a trifle complicated, and for that reason I’ll defer it to the next section. Before then, I want to give a definition of 5NF and say a little about that definition.

  • Definition: Relvar R is in fifth normal form (5NF), also known as projection-join normal form (PJ/NF), if and only if every JD of R is implied by the keys of R.

It should be clear that if a JD is implied by the keys of R, it certainly holds in R (i.e., it’s certainly “a JD of R”). But the converse is false: A JD can hold in R without being implied by the keys of R. In other words, the whole point about the 5NF definition is that the only JDs that hold in a 5NF relvar are ones we can’t get rid of—which means ones implied by keys (including trivial ones as a special case).[101]

I’d like to close this section by pointing out an intuitively attractive parallelism between the BCNF and 5NF definitions:

  • R is in BCNF if and only if every FD that holds in R is implied by the keys of R.

  • R is in 5NF if and only if every JD that holds in R is implied by the keys of R.

However, there’s a significant difference also. In the BCNF definition, we can simplify the phrase “implied by the keys” to “implied by some key,” meaning, loosely, that each FD that holds is an arrow out of some specific key considered in isolation (not necessarily the same key for every such FD, of course). By contrast, no such simplification applies to 5NF—the JDs that hold are JDs that are implied by the keys taken in combination, not necessarily just by some key considered in isolation. For example, suppose for the moment that relvar S had two keys, {SNO} and {SNAME}. Then the following JD (a repeat of one we’ve seen several times already)—

      { { SNO , SNAME } , { SNO , STATUS } , { SNAME , CITY } }

—would hold in that relvar. As it is, however, it doesn’t hold, because {SNAME} isn’t in fact a key. Exercise: Invent some sample data to demonstrate the truth of these claims.



[101] As usual, “getting rid of” a dependency (of any kind) really means replacing it by some multirelvar constraint.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset