FOURTH NORMAL FORM

You won’t be surprised to hear there’s such a thing as a trivial MVD:

  • Definition: Let X →→ Y be an MVD, M say, with respect to heading H. Then M 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 theorem (see Exercise 12.7):

  • Theorem: Let X →→ Y be an MVD, M say, with respect to heading H. Then M is trivial if and only if either (a) Y is a subset of X or (b) the union of X and Y is equal to H.

You probably won’t be surprised by the next definition, either:

  • Definition: Let relvar R have heading H and let X →→ Y be an MVD, M say, with respect to H. Then M is implied by the keys of R if and only if every relation r that satisfies R’s key constraints also satisfies M.

As with FDs and JDs, “implied by keys” here could just as well be “implied by superkeys” without making any significant difference. Also, if M is trivial, it’s satisfied by every relation r with heading H, and so it’s satisfied by every relation r that satisfies R’s key constraints a fortiori. Thus, trivial MVDs are always “implied by keys,” trivially. So suppose M is nontrivial. Then it’s easy to prove the following theorem:

  • Theorem: Let M be a nontrivial MVD that holds in relvar R. Then M is implied by the keys of R if and only if it reduces to an FD out of a superkey of R—i.e., the double arrow reduces to a single arrow, as it were, and the determinant is a superkey.

And now I can define 4NF:

  • Definition: Relvar R is in fourth normal form (4NF) if and only if every MVD of R is implied by the keys of R.

However, given the various definitions and theorems already discussed in this section, we can see that the following “operational” definition is valid too:

  • Definition: Relvar R is in fourth normal form (4NF) if and only for every nontrivial MVD X →→ Y that holds in R, X is a superkey for R (in other words, every such MVD reduces to “an FD out of a superkey”).

Of course, if an MVD is implied by the keys of R, it certainly holds in R—i.e., it’s certainly “an MVD of R.” However, the converse is false: An MVD can hold in R without being implied by the keys of R (relvar CTX provides an example). Thus, the whole point about the 4NF definition is that the only MVDs that hold in a 4NF relvar are ones we can’t get rid of—which means ones implied by keys (including trivial ones as a special case).[115]

Recall now from Chapter 10 the parallelism between the BCNF and 5NF definitions. In fact, that parallelism extends to the 4NF definition, too. That is, we have the following:

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

  • R is in 4NF if and only if every MVD 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.

Now, in the BCNF and 4NF definitions, we can simplify “implied by the keys” to just “implied by some key”; as noted in Chapter 10, however, the same is not true for the 5NF definition. In that sense, 4NF resembles BCNF more than it does 5NF. On the other hand, 4NF also resembles 5NF more than it does BCNF, in the sense that the 4NF and 5NF definitions both rely on context—by which I mean that the MVDs and JDs that hold in a 4NF or 5NF relvar involve, at least implicitly, all of the attributes of that relvar, whereas the same is not true for BCNF. (As I said earlier, the point about MVDs always going in pairs is important. Nothing analogous applies to FDs.)

Recall now from Chapter 6 the concept of FD preservation. Essentially, the idea was as follows: If the FD XY holds in relvar R, then the recommendation is to decompose R—assuming that decomposition is desired at all, and assuming further that it’s done on the basis of some FD other than XY itself—in such a way that X and Y are kept together in the same projection. Well, the concept extends to MVDs too—that is, the recommendation still applies if we replace the FD XY by the MVD X →→ Y throughout.

In closing this section, let me state explicitly that:

  1. If relvar R is in 5NF, it’s certainly in 4NF; likewise, if relvar R is in 4NF, it’s certainly in BCNF.

  2. A relvar can be in 4NF without being in 5NF (see Exercise 12.4).

  3. 4NF is always achievable. (In fact, of course, we know this already, because we know 5NF is always achievable, and now we know 5NF implies 4NF.)



[115] 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