Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
Healthy Shop database
MULTIPLE JOINs – Exercises
12. Exercise 8

Instruction

Good job! One more and we're done!

Exercise

Show the name and price of each product in the 'fruits' and 'vegetables' departments. Consider only those products that are not produced by 'GoodFoods'.

Stuck? Here's a hint!

Type:

SELECT
  p.name,
  p.price
FROM product p
JOIN producer prod
  ON p.producer_id = prod.id
JOIN department d
  ON d.id = p.department_id
WHERE d.name IN ('fruits', 'vegetables')
  AND prod.name != 'GoodFoods'