Attributes

Selection / Cartesian Product

The selection operator, applied to a relation R, creates a new relation with a subset of R's tuples. The tuples in the resulting relation are those that satisfy some condition C that involves the attributes of R. We denote this operation σc(R). The schema for the resulting relation is the

Combining Operations to Form Queries

If all we could do was to write single operations on one or two relations as queries, then relational algebra would not be as useful as it is. On the other hand, relational algebra, like all algebras, allows us to form expressions of arbitrary complexity by applying operators either to

Renaming

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

Extended Operators of Relational Algebra

An Algebra of Relational Operations presented the classical relational algebra, and Relational Operations on Bags introduced the modifications required to treat relations as bags of tuples rather than sets. The ideas of these two sections serve as a base for most of

Extending the Projection Operator

Well now reexamine the projection operator πL(R) introduced in Set Operations on Relations under projection. In the classical relational algebra, L is a list of (some of the) attributes of R. We extend the projection operator to allow it to compute with components of tuples as well

Additional Constraint Examples

The same constraint notation permits us to express far more than referential integrity. For instance, we can express any functional dependency as an algebraic constraint, although the notation is more awkward than the FD notation introduced in Functional Dependencies.

Page 7 of 10 Previous 1 2 3 4 5 6 7 8 9 10 Next