Results 1 to 2 of 2
  1. #1
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91

    How would 'sub-recipe' data best be related to the 'recipe' table in this database?


    have a junction table that ties products to ingredients to represent recipes. I intend to allow users to use "sub-recipes", which would mean you can include one recipe inside of another. Logically, this shakes down to mean that in the front-end, when you add a "sub-recipe" to a recipe, then in the back-end you just create an entry in product_has_ingredient tying each of the ingredients related to the sub-recipe product to the new product. However, this does not maintain the idea that the relationship is distinct from normal ingredients. I am trying to come up with a way to allow a product to optionally have a sub-recipe that maintains the same functional structure as what I have now. I can't think of a scalable way to do this that does not require some convolution of this schema.

    One option would be, rather than product_has_ingredient, to have product_has_recipe, and then then have ANOTHER junction table of recipe_has_ingredient. I'm hoping there's a better way!

    Click image for larger version. 

Name:	recipes.JPG 
Views:	24 
Size:	90.3 KB 
ID:	46895

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    You can use a BOM design, check out: https://stackoverflow.com/questions/...database-model.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-15-2021, 11:24 AM
  2. Replies: 6
    Last Post: 04-30-2019, 10:57 AM
  3. Replies: 1
    Last Post: 01-21-2019, 02:09 PM
  4. recipe file database help to start
    By JohnnyS in forum Access
    Replies: 6
    Last Post: 01-09-2017, 04:27 PM
  5. Database: From recipe to shopping list
    By schwabe in forum Database Design
    Replies: 3
    Last Post: 05-17-2014, 07:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums