Question Recipes relationship diagram module.

Hav0c

Member
Joined
Jul 15, 2011
Messages
5
Programming Experience
3-5
Hello people.
I have been struggling for some time now with drawing up a relationship diagram module for my scenario.

I have three tables as of now.
1) Recipes

2) Ingredients

3) RecipesIngredients
Recipes --(one to many) ---|> RecipesIngredients <|-----(many to one) --- Ingredients

Some of the Recipes
IDR
Name
1Platter (pre defined ingredients)
2Salad (pre defined ingredients)
3Sausage
4Chips

Some of the Ingredients
IDI
Name
1Lettuce
2Potatoes
3Tomato
4Meat
5Spices

What I can do is brake EVERY Recipe down to their basic Ingredients like

RecipesIngredients
ID
IDR
IDI
Quantity
1112
2121
3131
4151

For example to make a Platter one would need Lettuce, Tomato, Meat and Spices.


The problem.

a Salads ingredients are Lettuce and Tomato and that of Sausages are Meat and Spices.
So as a matter of fact a Platter is made up of both a Salad and Sausages which is both in my Recipes table.


The questions.

Should I brake every Recipe down to their bare Ingredients
OR
Is there a way to make the RecipesIngredients reflect more than one Recipes ID, take into consideration not all Recipes uses Recipes that are allready in the Recipes table.


Achievement.

What I am trying to achieve is when the user select a Platter.
They only see the Salad and Sausage being it an image or just the name on a labe BUT when they select the Salad or the Sausage they will see their Ingredients.
 
Top Bottom