Advertisement
Kamend1

3.8. Specific Ingredients

Jun 14th, 2024
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     i.name AS ingredient_name,
  3.     p.name AS product_name,
  4.     d.name AS distributor_name
  5. FROM ingredients AS i
  6. JOIN products_ingredients AS pi
  7. ON i.id = pi.ingredient_id
  8. JOIN products AS p
  9. ON p.id = pi.product_id
  10. JOIN distributors AS d
  11. ON i.distributor_id = d.id
  12. WHERE LOWER(i.name) = 'mustard' AND d.country_id = 16
  13. ORDER BY p.name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement