Databases Reference
In-Depth Information
The Query Design window in Microsoft Access was tailor-made for creating projections.
Just add the table to the design window, and drag the desired attribute names to the
design grid. Run the query to get the projection. Figure 5-9 shows the Query Design
window for computing the projection of
Books
onto the attributes ISBN and Price.
Figure 5-9. Creating a projection using the BOOKS table
5.3.7 Selection
Just as the operation of projection selects only a subset of the columns of a table, so the
operation of
selection
selects a subset of the rows of a table. The first step in defining the
operation of selection is to define a
selection condition
or
selection criterion
to be any
legally formed expression that involves:
Constants (i.e., members of any attribute domain)
•
Attribute names
•
Arithmetic comparison relations (=,
, <,
, >,
)
•
Logical operators (
and
,
or
,
not
)
•
For example, the following are selection conditions:
Price > $10.00
•
Price
$50.00
and
AuName = “Bronte”
•
(Price
$50.00
and
AuName = “Bronte”)
or
(
not
AuName = “Austen”)
•
If
condition
is a selection condition, then the result table obtained by applying the
corresponding selection operation to a table T is denoted by:
sel
condition
(T)
or sometimes by: