You have random "
LIKE
"s in your query
D a.restaurant_id=r.restaurant_id LIKE a.allergen='%fish%'
Try changing them to
AND
That is also a very old fashioned way to join tables. See
Visual Representation of SQL Joins[
^] and
Joining Tables in SQL[
^]
E.g.
SELECT r.restaurant_name FROM #restaurant as r
LEFT JOIN #ethnicity as e ON e.restaurant_id=r.restaurant_id
LEFT JOIN #allergen as a ON a.restaurant_id=r.restaurant_id AND e.restaurant_id=a.restaurant_id
WHERE a.allergen='%fish%' and e.ethnicity='%asian%';