January 2014 Archive


To control the names of the attributes used for relations that are constructed by applying relational-algebra operations, it is often convenient to use an operator that clearly renames relations. We shall use the operator 1 to rename a relation R. The resulting relation has precisely the

Dependent and Independent Operations

Some of the operations that we have explained in previous sections can be expressed in terms of other relational-algebra operations. For instance, intersection can be expressed in terms of set difference:

A Linear Notation for Algebraic Expressions

In Combining Operations to Form Queries we used trees to represent complicated expressions of relational algebra. Another option is to invent names for the temporary relations that correspond to the interior nodes of the tree and write a sequence of assignments that create a

Relational Operations on Bags

While a set of tuples (i.e., a relation) is a simple, natural model of data as it might appear in a database, commercial database systems rarely, if ever, are based entirely on sets. In some situations, relations as they appear in database systems are allowed to have duplicate

Union, Intersection, and Difference of Bags

When we take the union of two bags, we add the number of occurrences of each tuple. That is, if R is a bag in which the tuple t appears n times, and S is a bag in which the tuple t appears m times, then in the bag R U S tuple t appears n + m times. Note that either n or m (or

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.

Page 1 of 1 Previous 1 Next