EMBEDDED DEPENDENCIES

Recall relvar CTXD from Chapter 9 (a sample value, repeated from Figure 9-3, is shown in Figure 12-2 overleaf). That relvar can be regarded as an extended version of relvar CTX as discussed earlier in the present chapter. The predicate is Teacher TNO spends DAYS days with textbook XNO on course CNO,[116] and the sole key is {CNO,TNO,XNO}.

As we saw in Chapter 9, relvar CTXD suffers from redundancy;[117] yet it’s in 5NF, which means no JDs (and therefore no MVDs, a fortiori) hold apart from trivial ones. In particular, therefore, the MVDs

     { CNO } →→ { TNO } | { XNO }
The 5NF relvar CTXD—sample value

Figure 12-2. The 5NF relvar CTXD—sample value

do not hold[118]—but they do hold in the projection of CTXD on {CNO,TNO,XNO}. For that reason, those MVDs are said to be embedded in the original relvar CTXD. In general, given some relvar R with heading H, an embedded dependency with respect to R is a dependency that doesn’t hold in R itself but does hold in the projection of R on some proper subset of H. As the example illustrates, therefore (and as was noted in Chapter 9, albeit in different words), embedded dependencies cause redundancy, but that redundancy can’t be eliminated by taking projections. Such redundancies thus correspond to constraints that must be separately stated and enforced (see Exercise 12.2).

Observe, incidentally, that the foregoing notion of embedding applies to JDs (and therefore to MVDs)[119] but not to FDs. That is, given some relvar R and a projection of R whose heading includes both X and Y, the FD XY holds in that projection if and only if it holds in R itself. For example, the FD {CITY} → {STATUS} holds in relvar S as such and also in every projection of that relvar that retains both of those attributes.



[116] This is the predicate I gave in Chapter 9, but a more accurate version might be: Course CNO can be taught by teacher TNO and uses textbook XNO, and teacher TNO spends DAYS days with textbook XNO on course CNO. And we might want to add DAYS is greater than zero as well. See Chapter 15 for further discussion.

[117] As noted in Chapter 9, one of my reviewers disputed this claim. Again, see Chapter 15 for further discussion.

[118] I’m being a little sloppy here; by the definitions given earlier in the chapter, the MVDs {CNO} →→ {TNO}|{XNO} can’t possibly hold in relvar CTXD, since they fail to mention the DAYS attribute. But I think you see what I mean.

[119] For an example of an embedded JD that’s not an embedded MVD, suppose relvar SPJ from Chapter 9 is extended to include a quantity attribute, QTY, thereby forming a new relvar SPJQ. Suppose the FD {SNO,PNO,JNO} → {QTY} holds in SPJQ (i.e., {SNO,PNO,JNO} is a key). Then {{SNO,PNO},{PNO,JNO},{JNO,SNO}} is a JD that holds in the projection of SPJQ on {SNO,PNO,JNO} but not in SPJQ itself.

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

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