References

References

The fact that movies like Star Wars will appear in various relations that are values of the movies attribute in the nested relation Stars is a cause of redundancy. In effect, the schema of "Nested Relations" Example (a) has the nested-relation analog of not being in BCNF. On the other hand, decomposing this Stars relation will not eliminate the redundancy. Instead, we need to arrange that among all the tuples of all the movies relations, a movie appears only once.

To solve the problem, object-relations need the ability for one tuple t to refer to another tuple s, instead of including s directly in t. We therefore add to our model an additional inductive rule: the type of an attribute can also be a reference to a tuple with a given schema.

If an attribute A has a type that is a reference to a single tuple with a relation schema named R, we show the attribute A in a schema as A(*R). Notice that this situation is similar to an ODL relationship A whose type is R; i.e., it connects to a single object of type R. Likewise, if an attribute A has a type that is a set of references to tuples of schema R, then A will be shown in a schema as A({*R}).  This situation is similar to an ODL relationship A that has type Set<R>.

Example (a): A proper way to fix the redundancy in "Nested Relations" Figure (a), is to use two relations, one for stars and one for movies. The relation Movies will be an ordinary relation with the same schema as the attribute movies in "Nested Relations" Example (a). The relation Stars will have a schema similar to the nested relation Stars of that example, but the movies attribute will have a type that is a set of references to Movies tuples. The schemas of the two relations are thus:

Movies (title, year, length)
Stars (name, address (street, city), birthdate,
      movies ({*Movies}))

Sets of references as the value of an attribute

The data of "Nested Relations" Figure (a), converted to this new schema, is shown in Figure (a).  Notice that, because each movie has only one tuple, though it can have many references, we have eliminated the redundancy inherent in the schema of "Nested Relations" Example (a).


Tags