Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Healthy Shop database
MULTIPLE JOINs – Exercises
12. Exercise 8


Good job! One more and we're done!


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

Remember that if you place the condition for the producer's name in the WHERE clause, you won't get rows for products without a producer.

Stuck? Here's a hint!

To get also products that don't have a producer, you'll need to join the Producer table, like so:

FROM Product P
LEFT JOIN Producer Prod
  ON P.ProducerId = Prod.Id
  AND Prod.Name != 'GoodFoods'
JOIN Department D
  ON D.Id = P.DepartmentId