4/21/99

CSE444

HW3 Possible Solutions

8.3

  1. P sname Suppliers JN (s color="red" Parts) JN catalog
  2. P sid catalog JN (s color="red" or color = "green" Parts)
  3. P sid(s address="221 Packer Street" Suppliers) Ý (P sid (s color="red" Parts) JN catalog)
  4. P sid(s color="red" Parts JN catalog) n P sid (s color="green" Parts JN catalog)
  5. P sid (catalog / P pid Parts)
  6. P sid (catalog / P pid (s color="red" Parts))
  7. P sid (catalog / P pid(s color="red" or color="green" Parts))
  8. P sid (catalog / P pid (s color="red" Parts)) Ý P sid (catalog / P pid (s color="green" Parts))

8.4

  1. Find the names of all suppliers who sell some red part for less than $100.
  2. 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).
  3. 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.