Database Structure Advice Needed

前端 未结 8 707
别跟我提以往
别跟我提以往 2021-01-29 23:15

Im currently working on a site which will contain a products catalog. I am a little new to database design so I\'m looking for advice on how best to do this. I am familiar wit

8条回答
  •  被撕碎了的回忆
    2021-01-29 23:42

    If you want categories to have multiple parent categories, then it's just a "many to many" relationship instead of a "one to many" relationship. You'll need to put a bridging table between category and itself.

    However, I doubt this is what you want. If I'm looking in the category Aircraft > Wood then I wouldn't want to see items from Boating > Wood. There are two Wood categories because they contain different items.

提交回复
热议问题