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
6. Exercise 2

Instruction

Good start! How about this one?

Exercise

For each fruit (found in the fruits department) show the product's shelf id, name, price, and number of calories.

Stuck? Here's a hint!

Type:

SELECT
  p.shelf_id,
  p.name,
  p.price,
  nd.calories
FROM product p
JOIN department d
  ON p.department_id = d.id
JOIN nutrition_data nd
  ON nd.product_id = p.id
WHERE d.name = 'fruits'