Medical Center database
Non primary-foreign key JOINs
Non-equi JOINs
Non-equi self JOINs
Summary
28. Exercise 3

Instruction

Here comes the last one!

Exercise

For each buyer with funds less than 8000, show their name together with the names of all paintings and sculptures that are outside of their price range.

Stuck? Here's a hint!

Type:

SELECT
  buyer.name,
  item.name
FROM item
JOIN buyer
  ON item.price > buyer.funds
  AND buyer.funds < 8000
  AND item.type IN ('sculpture', 'painting')

Console

Code editor

Result

TableConsole