S
with Head(S)=A1…An
,
the selection operation creates a new table, denoted by S where C
, with the same set of attributes, and consisting of those tuples of S
that obey the selection condition denoted by C
.
A condition of selection determines, for each given tuple of the table, whether that tuple is qualified to remain in the set of selected rows making up the answer.
The form a condition C
can take is defined recursively as follows.
C
can be any comparison of the form Ai∝Aj
or Ai∝a
,
where Ai
and Aj
are attributes of S
having the same domain,
a
is a constant from Dom(Ai)
,
and ∝
is one of the comparison operations
<
, >
, <=
, >=
, and <>
.
The table S where Ai∝Aj
t
of S
with the property that
t[Ai]∝t[Aj]
; the table
S where Ai∝a
contains all rows t
of S
with the property t[Ai]∝a
.
C
and C’
are conditions, then new conditions can be formed by writing C and C’
, C or C’
, and finally not C
,
possibly enclosing any such newly formed conditions in parentheses.
If U:=S where C1
V:=S where C2
and
connector: S where C1 and C2
means U∩V
.
or
connector: S where C1 or C2
means U∪V
.
not
connector: S where not C1
means S–U
.
|