Database Design Question - Categories / Subcategories

后端 未结 6 1823
太阳男子
太阳男子 2020-12-05 12:18

I have a question for how I would design a few tables in my database. I have a table to track Categories and one for Subcategories:

TABLE Category
    Catego         


        
6条回答
  •  伪装坚强ぢ
    2020-12-05 12:37

    Attach tags to the products in instead of a category hierarchy. It is much more flexible.

    create table product (id, name,...)
    create table tag (id, name, description)
    create table product_tag (product_id, tag_id)
    

提交回复
热议问题