The Relational Algebra

The Relational Algebra
The relational algebra is a theoretical language with operations that work on one or
more relations to define another relation without changing the original relation(s). Thus,
both the operands and the results are relations, and so the output from one operation can
become the input to another operation. This allows expressions to be nested in the relational
algebra, just as we can nest arithmetic operations. This property is called closure:
relations are closed under the algebra, just as numbers are closed under arithmetic
operations.
The relational algebra is a relation-at-a-time (or set) language in which all tuples,
possibly from several relations, are manipulated in one statement without looping. There
are several variations of syntax for relational algebra commands and we use a common
symbolic notation for the commands and present it informally. The interested reader is
referred to Ullman (1988) for a more formal treatment.
There are many variations of the operations that are included in relational algebra. Codd
(1972a) originally proposed eight operations, but several others have been developed.
The five fundamental operations in relational algebra, Selection, Projection, Cartesian
product, Union, and Set difference, perform most of the data retrieval operations that we
are interested in. In addition, there are also the Join, Intersection, and Division operations,
which can be expressed in terms of the five basic operations. The function of each operation
is illustrated in Figure 4.1.
The Selection and Projection operations are unary operations, since they operate on one
relation. The other operations work on pairs of relations and are therefore called binary
operations. In the following definitions, let R and S be two relations defined over the
attributes A = (a1, a2, . . . , aN) and B = (b1, b2, . . . , bM), respectively.
The Relational Algebra The Relational Algebra Reviewed by Shopping Sale on 14:14 Rating: 5

No comments:

Powered by Blogger.