You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 Calculate the nutritional value separately and write it down in one line in the table "products"
2 Keep records of dishes (dishes - products composition):
In meal table (replace connection product_id to dish_id)
id
dish_id
datetime
portion
99
1
2022-12-06 19:22:13
120
Create dish table
id
dish name
dish_products_id
1
Crab salad
1
Create dish_products table
id
dish_id
product_id
portion
1
1
14
280
2
1
27
250
3
1
28
140
Also, it's possible add columns (proteins, fats, carbohydrates, calories) to the dish table - which were recalculated when added to the dish_products table
OR
In meal table add column (dish_id) and then one dish_products table could be created (which would have references to the ingredients),
And the name and nutritional value remain (and are recalculated) as before
Now: Each meal item is recorded separately.
Example: Buckwheat with chicken breast
meal table
products table
But what to do with more complex dishes (soups, salads)
Example: Crab salad consisting of 3 ingredients.
List Products
Salad ingredients
Result
The text was updated successfully, but these errors were encountered: