Relational Algebra

The Query Processor

The portion of the DBMS that most affects the performance that the user sees is the query processor. In following figure the query processor is

Database Programming

The following categories cover database programming. a) Relational Algebra b) The Database Language SQL c) Constraints and Triggers d) System Aspects of SQL e) Object-Orientation in Query Languages f) Logical Query Languages We start in category “Relational Algebra” with an abstract treatment of queries in the

An Algebra of Relational Operations

In order to start our study of operations on relations, we shall learn about a special algebra, called relational algebra that comprises some simple but powerful ways to construct new relations from given relations. When the given relations are stored data, then the constructed

Set Operations on Relations

The three most common operations on sets are union, intersection, and difference. We assume the reader is familiar with these operations, which are described as follows on arbitrary sets R and S:

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

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 0 of 3 « Previous 1 2 3 Next »