In relational algebra, a generalized selection is a unary operation written as
For an example, consider the following tables where the first table gives the relation
Formally the semantics of the generalized selection is defined as follows:
The result of the selection is only defined if the attribute names that it mentions are in the header of the relation that it operates upon.
The generalized selection is expressible with other basic algebraic operations. A simulation of generalized selection using the fundamental operators is defined by the following rules:
In SQL, general selections are performed by using WHERE
definitions with AND
, OR
, or NOT
operands in SELECT
, UPDATE
, and DELETE
statements.