# Recipes with ingredients with suppliers

**URL:** <https://community.glideapps.com/t/recipes-with-ingredients-with-suppliers/78157>\
**Category:** Ask for Help\
**Created:** [November 24, 2024, 6:11am UTC](https://community.glideapps.com/t/recipes-with-ingredients-with-suppliers/78157 "2024-11-24T06:11:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthijs\_Bouma](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/matthijs_bouma/32/82404_2.png) [@Matthijs\_Bouma](https://community.glideapps.com/u/Matthijs_Bouma)\
**Post date:** [November 24, 2024, 6:11am UTC](https://community.glideapps.com/t/recipes-with-ingredients-with-suppliers/78157/1 "2024-11-24T06:11:49Z")

</div>

I run a snack business, where I make snacks and sauces and spice mixes which I sell. I want to make an app where a recipe has N ingredients (each with an amount: X gr of mayonnaise, Y ml of vinegar). Ingredients are in a separate table, to which the lines must link. In the ingredients table, the stock is given as well as a minimum amount. Each ingredient has a price, which defines the cost of production. Each ingredient has a supplier. Suppliers are in a separate table, and each supplier may supply multiple ingredients (rolled oats, raisins, &c). I’ve tried different strategies with the AI, as ‘recipes with ingredients’ doesn’t float (so I’ve tried clubs with members), but each time what I get is not relational, but just tables (set of clubs with N members; and people who have no apparent relationship with any clubs). What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 24, 2024, 2:54pm UTC](https://community.glideapps.com/t/recipes-with-ingredients-with-suppliers/78157/2 "2024-11-24T14:54:12Z")

</div>

> [@Matthijs\_Bouma](#):
>
> I’ve tried different strategies with the AI, as ‘recipes with ingredients’ doesn’t float (so I’ve tried clubs with members)

Not sure what you mean here, do you mean you’re trying to ask AI what structure should you get?

Here’s my suggestion.

#### 1. **Ingredients Table**

| ingredient\_id | name | stock\_quantity | minimum\_stock | cost\_per\_unit | supplier\_id |
| --- | --- | --- | --- | --- | --- |
| I001 | Mayonnaise | 5000 | 2000 | 0.5 | S001 |
| I002 | Vinegar | 2000 | 500 | 0.2 | S002 |
| I003 | Chili Powder | 1000 | 200 | 1.0 | S001 |

* * *

#### 2. **Suppliers Table**

| supplier\_id | name | contact\_info |
| --- | --- | --- |
| S001 | Supplier A | +1-234-567-8901 |
| S002 | Supplier B | +1-987-654-3210 |

* * *

#### 3. **Recipes Table**

| recipe\_id | name |
| --- | --- |
| R001 | Spicy Sauce |
| R002 | Salad Dressing |

* * *

#### 4. **Recipe\_Ingredients Table**

| recipe\_ingredient\_id | recipe\_id | ingredient\_id | quantity |
| --- | --- | --- | --- |
| RI001 | R001 | I001 | 200 |
| RI002 | R001 | I002 | 50 |
| RI003 | R001 | I003 | 10 |
| RI004 | R002 | I001 | 100 |
| RI005 | R002 | I002 | 30 |

### **How Tables Relate**

1. `supplier_id` in **Suppliers Table** links to `supplier_id` in **Ingredients Table**.
2. `ingredient_id` in **Ingredients Table** links to `ingredient_id` in **Recipe\_Ingredients Table**.
3. `recipe_id` in **Recipes Table** links to `recipe_id` in **Recipe\_Ingredients Table**.

Does that answer your question?
