Databases Reference
In-Depth Information
123-456-
7 890
0-12-333433-
3
1
Big House
On Liberty
1
$25.00
123-456-
7 890
0-103-45678-
9
1
Big House
Iliad
1
$25.00
123-456-
7 890
0-91-335678-
7
Faerie
Q ueene
1
Big House
1
$15.00
123-456-
7 890
0-99-999999-
9
1
Big House
Emma
1
$20.00
123-456-
7 890
1-22-233700-
0
1
Big House
Visual Basic
1
$25.00
123-456-
7 890
1-1111-1111-
1
1
Big House
C++
1
$29.95
999-999-
9 999
0-91-045678-
5
2
Alpha Press
Hamlet
2
$20.00
999-999-
9 999
0-555-55555-
9
2
Alpha Press
Macbeth
2
$12.00
999-999-
9 999
0-99-777777-
7
2
Alpha Press
King Lear
2
$49.00
999-999-
9 999
0-123-45678-
0
2
Alpha Press
Ulysses
2
$34.00
If we now project onto the PUBLISHERS table, we get the left semi-join:
PUBLISHERS left-semi-join PUBLISHERS.PubID = BOOKS.PubID BOOKS
for which the result table is shown in Table 5-19.
Table 5-19. Result table from a semi-join
PubID
PubName
PubPhone
3
Small House
714-000-0000
1
Big House
123-456-7890
2
Alpha Press
999-999-9999
This is the set of all publishers that have book entries in the BOOKS database.
5.3.12 Other Relational Algebra Operations
There is one more operation in relational algebra that occurs from time to time, called the
quotient . However, since this operation is less common, and a bit involved, we will cover
it in Appendix B. (You may turn to that appendix after finishing this chapter, if you are
interested.)
5.3.13 Optimization
Let us conclude this discussion with a brief remark about optimization . As we have
discussed, statements in the relational algebra are procedural ; that is, they describe a
Search WWH ::




Custom Search