4/21/99
CSE444
HW3 Possible Solutions
8.3
- P
sname Suppliers JN (s
color="red" Parts) JN catalog
- P
sid catalog JN (s
color="red" or color = "green" Parts)
- P
sid(s address="221
Packer Street" Suppliers) Ý (P
sid (s color="red" Parts) JN
catalog)
- P
sid(s color="red"
Parts JN catalog) n P sid (s
color="green" Parts JN catalog)
- P
sid (catalog / P pid
Parts)
- P
sid (catalog / P pid
(s color="red" Parts))
- P
sid (catalog / P pid(s color="red" or color="green" Parts))
- P
sid (catalog / P pid
(s color="red" Parts)) Ý P sid (catalog / P pid (s color="green"
Parts))
8.4
- Find the names of all suppliers who sell some red part for less than $100.
- As written, this query is illegal since it attempts to project sname from a table with
only the sid column. By moving the parentheses around, we find the result to be identical
to 1).
- Find the names of all suppliers who sell some red part for less than $100 and who sell
some green part for less than $100.