Avoiding Redundancy

We should be careful to say everything once only. For example, we have used a relationship Owns between movies and studios. We might also choose to have an attribute studioName of

Additional ODL Concepts

There are many other features of ODL that we must study if we are to express in ODL the things that we can express in the E/R or relational models. In this section, we shall cover:


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

Natural Joins / Theta-Joins

More frequently than we want to take the product of two relations, we find a need to join them by pairing only those tuples that match in some way. The simplest kind of match is the natural join of two relations R and S, denoted R x S, in which we pair only those tuples from R

Selection on Bags / Product of Bags / Joins of Bags

To apply a selection to a bag, we apply the selection condition to each tuple separately. As always with bags, we do not remove duplicate tuples in the result.


An attribute of the join operator is that it is possible for certain tuples to be "dangling"; that is, they fail to match any tuple of the other relation in the common attributes. Dangling tuples do not have any trace in the result of the join, so the join may not represent the data of

Referential Integrity Constraints

A common kind of constraint, called "referential integrity" in The Modeling of Constraints, declares that a value appearing in one context also appears in another, related context. We saw referential integrity as a matter of relationships "making sense". That is, if an object or

Correlated Subqueries

The simplest subqueries can be evaluated once and for all, and the result used in a higher-level query. A more complicated use of nested subqueries requires the subquery to be evaluated many times: once for each assignment of a value to some term in the subquery that comes

Modification of Constraints

It is possible to add, modify, or delete constraints at any time. The way to express such modifications depends on whether the constraint involved is associated with an attribute, a table, or a database schema.

Triggers in SQL

The SQL trigger statement gives the user a number of different options in the event, condition, and action parts. Here are the principal features. 1. The action may be executed either before or after the triggering event. 2. The action can refer to both old and/or new values of tuples that were inserted, deleted, or updated in the event that triggered the action.

Page 0 of 1 Previous 1 Next