EXAMPLE 1

It’s my claim that design theory as a field of investigation is, in general, still wide open. To bolster this claim, in this section and the next few I want to give some examples of designs that (a) are fully normalized and fully orthogonal (at least in most cases) and yet (b) still suffer from various redundancies (again, in most cases).

For my first example, consider the following simple relvar, which represents a set of names and addresses (the predicate is Person NAME resides at address ADDR):

     NADDR { NAME , ADDR }
           KEY { NAME }

Suppose attribute ADDR in this relvar is tuple valued, where the tuples in question have attributes STREET, CITY, STATE, and ZIP. (Yes, tuple valued attributes or TVAs are legal, just as relation valued attributes or RVAs are legal—see Chapter 4—and for much the same reasons.) A sample value for this relvar is shown in Figure 15-1.

Relvar NADDR (ADDR is tuple valued)—sample value

Figure 15-1. Relvar NADDR (ADDR is tuple valued)—sample value

Assume now for the sake of the example, as we did in Exercise 6.2, that whenever two ADDR values have the same ZIP component, they also have the same CITY and STATE components. Then the foregoing design clearly involves some redundancy. Yet there’s no violation of normalization here; in particular, the functional dependency

     { ZIP } → { CITY , STATE }

does not hold. (Why not? Answer: Because FDs are defined to hold among attributes, not among components of attributes.)

That said, let me now point out that the foregoing FD does hold in the result of replacing NADDR by the result of the following expression:

     NADDR UNWRAP ( ADDR )

Note: The Tutorial D UNWRAP operator effectively replaces some tuple valued attribute by a set of attributes, one for each component of that TVA. Thus, the foregoing expression returns a result with attributes NAME, STREET, CITY, STATE, and ZIP. (Of course, that result is still only in 2NF, not even BCNF, and it still suffers from redundancy.)

We might conclude from this example that unwrapping TVAs is a good idea. But is it enough of a good idea to be enshrined as a principle of good design?[157]



[157] In his book An Introduction to Relational Database Theory (Ventus, 2010), Hugh Darwen suggests that it might be, and that we might consider a wrap-unwrap normal form in this connection. He also suggests in that same book that ungrouping RVAs is a good idea, too, and that we might thus also consider a group-ungroup normal form accordingly.

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

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