Food Product Database Modeling

I am trying to create a recipe database and I am having trouble setting it up correctly. I have no idea if I'm on the right track or not, but here's what I have.

recipes (recipeID, etc.)
component (componentID, etc.)
recipeIngredient (recipeID, componentIDID, quantity)
category (categoryID, name)
recipeCategory (recipeID, categoryID, name, etc.)

So, I have a few questions.

  • How am i doing this? Is this design good from everything you know?
  • How do I complete the preparation steps? Should I create an additional many-to-many implementation (something like preparation (prepID, etc.) and recipePrep (recipeID, prepID)) or just add directions to the recipe table? I would like it to be an ordered list in the user interface (web page).

Thank you for your help.

+5
source share
3 answers

some thoughts:

You might want to use the same table for the recipe and ingredient by specifying the type indicator column. The reason is that recipes may contain sub-recipes. Call the combo table "Item". Then the RecipeIngredient table will look like

 RecipeIngredient (RecipeId, ItemId, Amount).  

, .

- (, , , ), . ( uofm), , , "1 " "2 tbs". , , , , , . , .

, 1: M , , RecipeCategory Name. , .

, , , RecipePreparationSteps ( - ) .

, . .

. .

, RecipeIngredient RecipePreparation, . , "RecipeLine", . , , . , .

, , -.

+1

, DatabaseAnswers?

+1

, . :

  • I do not see the need for a recpieCategory table. The one-to-many between recipe and category must succeed.
  • The Preparation table should contain the 1st step for each recipe. I would not try to reuse the steps between recipes.
0
source

All Articles