Skip to content
Advertisement

How to join queries with a subquery?

So I’m a total newbie trying to solve this exercise where I have to find all the dishes that are marked as Vegetarian but contain Turkey meat in their ingredients.

This is what I’ve tried (this is where I inner join 3 tables to find the ingredients):

this is where I can’t seem to be able to join the subquery to identify the Vegetarian tag:

The diagram of the database is here for reference:

The diagram of the database is here for reference

Advertisement

Answer

Let first find out how many dishes have Turkey meat as ingredient.

You have:

Then get all dishes with tag ‘Vegetarian’.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement