Ingredient (iID, iname, madeIn)
Dish (dID, dname, cuisine, vegetarian, introduction)
Recipe (dID, iID, usageDec)
List the dID, dname of the dish(s) that use all 3 ingredients (“Ginger”, “Onion” and “Garlic”) in its recipe. In descending order of dID, remove duplicates.
I have given my code below. Not getting the right output. Help me out please.
SELECT Distinct d.dID, D.dname
FROM Dish D, Ingredient I, Recipe R
WHERE D.dID=R.dID AND
I.iname="Garlic" AND
I.iname="Ginger" AND
I.iname="Onion"
ORDER BY D.dID DESC;