Puneet Varma (Editor)

Generalized selection

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In relational algebra, a generalized selection is a unary operation written as σ φ ( R ) where φ is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators (and), (or) and ¬ (negation). This selection selects all those tuples in R for which φ holds.

For an example, consider the following tables where the first table gives the relation P e r s o n and the second the result of σ A g e 30     W e i g h t 60 ( P e r s o n ) .

Formally the semantics of the generalized selection is defined as follows:

σ φ ( R ) = {   t : t R ,   φ ( t )   }

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:

σ φ ψ ( R ) = σ φ ( R ) σ ψ ( R ) σ φ ψ ( R ) = σ φ ( R ) σ ψ ( R ) σ ¬ φ ( R ) = R σ φ ( R )


In SQL, general selections are performed by using WHERE definitions with AND, OR, or NOT operands in SELECT, UPDATE, and DELETE statements.

References

Generalized selection Wikipedia