A USEFUL THEOREM

I said in Chapter 9 that in practice it’s quite unusual to find a relvar that’s in BCNF and not in 5NF. In fact, there’s a theorem that addresses this issue:

  • Theorem: Let R be a BCNF relvar and let R have no composite keys; then R is in 5NF. (Recall from Chapter 1 that a composite key is a key consisting of two or more attributes.)

This theorem is quite useful. What it says is, if you can get to BCNF (which is easy enough), and if there aren’t any composite keys in your BCNF relvar (which is often but not always the case), then you don’t have to worry about the complexities of JDs and 5NF in general—you know without having to think about the matter any further that the relvar simply is in 5NF. Note: Actually the theorem applies to 3NF, not BCNF; that is, it really says a 3NF relvar with no composite keys is in 5NF. But every BCNF relvar is in 3NF, and in any case BCNF is much more important than 3NF, pragmatically speaking (as well as being conceptually simpler).

Caveat: I don’t know why, but people often misinterpret the foregoing theorem. To be specific, given that a BCNF relvar with no composite keys is “automatically” in 5NF, people often seem to think that simply introducing a surrogate key (noncomposite by definition) into a BCNF relvar “automatically” means the relvar is now in 5NF. But it doesn’t mean that at all! If the relvar wasn’t in 5NF before the surrogate was introduced, it won’t be in 5NF afterward. In particular, if it had a composite key before the surrogate was introduced, it’ll still have one afterward.

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

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