Jump to content

branquito

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

branquito's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=371671:date=May 5 2006, 02:51 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 5 2006, 02:51 PM) [snapback]371671[/snapback][/div][div class=\'quotemain\'][!--quotec--] That's the wrong way to think about it -- you only need two tables, recipes & categories. That relationship is simple; then, simply store a parent_category_id in the categories table, and have the top-level ones have a NULL parent. That's it. [/quote] yes ,but then you would have repeating parent_category_id field values for all recipes that belong to same category, and that way it would be hard to maintain database in future..
  2. let's say you have a book of recipes, and you want to make database to hold this information.. you have [b]Categories[/b] of recipes, then [b]subCategories[/b] and final [b]Recipes[/b], so nothing complicated.. BUT some categories do not have subcategories, only recipes that belong to them.. so i know you relate categories to subcategories as one to many, and subcategories to recipes as one to many or many to many (as one recipe may exist in more than one subcategory) and that's all ok.. but HOW TO relate now categories that do not have subcategories to recipes table..when in recipes table is needed field from subcategories (enforce referential integrity).. thank you very much Branko
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.