Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Medical Center database
Non primary-foreign key JOINs
Non-equi JOINs
Non-equi self JOINs
Summary

Instruction

Amazing! How about this one?

Exercise

For each couple that has an apartment, show their name, apartment ID, and location for all apartments that are within their price range and in their preferred location.

Stuck? Here's a hint!

Type:

SELECT
  couples.couple_name,
  apartments.id,
  location
FROM couples
JOIN apartments
  ON apartments.price BETWEEN couples.min_price AND couples.max_price
WHERE apartments.location = couples.pref_location