title: MySQL query in a database of food inventory and recipes
body: <p>I'm new to mysql and I have to do a kitchen inventory database with recipes for a school project. I'm trying to get a query that shows recipes and users when users have all the ingredients to that recipe. I'm trying to work with the following tables for this query:</p>
  <p><strong>Products</strong></p>
  <ul>
  <li>ProdID</li>
  <li>name (brand included)</li>
  <li>tag - FK</li>
  </ul>
  <p><strong>Tags</strong> (Since there are different brands of products, a tag table to associate each product to a generic type, like orange juice)</p>
  <ul>
  <li>TagID</li>
  <li>name</li>
  </ul>
  <p><strong>Recipes</strong></p>
  <ul>
  <li>RecipeID</li>
  <li>Name</li>
  <li>Description</li>
  </ul>
  <p><strong>Ingredients</strong> (To associate all the ingredients with each recipe)</p>
  <ul>
  <li>IgrID</li>
  <li>TagID - FK</li>
  <li>RecipeID - FK</li>
  </ul>
  <p><strong>Inventory</strong></p>
  <ul>
  <li>InvID</li>
  <li>UserID</li>
  <li>ProductID - FK</li>
  <li>QTY</li>
  </ul>
  <p>My idea was to get all the ingredients a user have and then check if they complete a recipe, but I don't know how to put together all the tables to get the first part. I tought of doing a join with users ingredients and recipes for the second part, I don't know if it would work though. Maybe the structure I made is unnecessarily complex too. Could anyone give me a hand?</p>