the
SELECT operation is ussed to choose a
subset of the
tuples from a
relation that satisfies a
selection condition. we can consider the select operation to be a
filter that keeps only those tuples that satisfy a qualifying condition. alternatively, we can consider the select operation to restrict the tuples in a relation to only those tuples that satisfy the condition. the select operation can also be visualized as a horizontal partition of the relation into two sets of tuples--those tuples that satisfy the conddition and are selected, and those tuples that do not satisfy the condition and are filtered out.
in general, the select operation is denoted by

where the symbol

is used to denote the select operator and the selection condition is a boolean expression specified on the attributes of relation

. notice that

is generally a
relational algebra expression whose result is a relation--the simplest such expression is just the name of a database relation. the relation resulting from the select operation has the same attributes as

.
the Boolean expression specified in <selection condition> is made up of a number of clauses of the form

or

where <attribute name> is the name of an attribute of

, <comparison op> is normally one of the operators

, and <constant value> is a constant value from the attribute domain. clauses can be connected by the standard boolean operators
AND,
OR, and
NOT to form a general selection condition. for example, to select the tuples for all employees who either work in department 4 and make over $25,000 per year, or work in department 5 and make over $30,000, we can specify the following SELECT operation:

notice that all the comparison operators in the set

can apply to attributes whose domains are ordered values, such as numeric or date domains. domains of strings of characters are also considered to be ordered based on the collating sequence of the characters. if the domain of an attribute is a set of unordered values, then only the comparison operators in the set

can be used. an example of an unordered domain is the domain

, where no order is specified among the various colors. some domains allow additional types of comparison operators; for example, a domain of character strings may allow the comparison operator SUBSTRING_OF.
the select operator is
commutative.
[cite:@elmasri_db_2015 chapter 8.1.1 the SELECT operation]