Databases Reference
In-Depth Information
T where condition
and is the table obtained from T by keeping only those rows that satisfy the selection
condition.
For example, see Table 5-7.
Table 5-7. T h e BOOKS table in the LIBRA R Y databse
ISBN
Title
PubID
Price
0 -103-45678-9
I liad
1
$25.00
0 -11-345678-9
Moby-Dick
3
$49.00
0 -12-333433-3
O n Liberty
1
$25.00
0 -12-345678-9
J ane Eyre
3
$49.00
0 -123-45678-0
U lysses
2
$34.00
0 -321-32132-1
B alloon
3
$34.00
0 -55-123456-9
Main Street
3
$22.95
0 -555-55555-9
Macbeth
2
$12.00
0 -91-045678-5
H amlet
2
$20.00
0 -91-335678-7
F aerie Queene
1
$15.00
0 -99-777777-7
K ing Lear
2
$49.00
0 -99-999999-9
E mma
1
$20.00
1 -1111-1111-1
C ++
1
$29.95
1 -22-233700-0
V isual Basic
1
$25.00
The table
is shown in Table 5-8:
T a ble 5-8. The resulting tabl e
ISBN
Title
PubID
Price
0 -12-345678-9
Jane Eyre
3
$ 49.00
0-11-345678-9
Moby-Dick
3
$49.00
0 -99-777777-7
King Lear
2
$ 49.00
0-123-45678-0
Ulysses
2
$34.00
1 -1111-1111-1
C++
1
$ 29.95
0 -321-32132-1
Balloon
3
$ 34.00
Some authors refer to selection as restriction , which does seem to be a more appropriate
term and has the advantage that it is not confused with the SQL SELECT statement,
which is much more general than just selection. However, it is less common than the term
selection, so we will use this term.
The Query Design window in Microsoft Access was also tailor-made for creating
selections. We just use the Criteria rows to apply the desired restrictions. For example,
Figure 5-10 shows the design window for the selection:
Search WWH ::




Custom Search