Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
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.ShelfId,
  P.Name,
  P.Price,
  ND.Calories
FROM Product P
JOIN Department D
  ON P.DepartmentId = D.Id
JOIN NutritionData ND
  ON ND.ProductId = P.Id
WHERE D.Name = 'fruits'