电子商务网站的最佳数据库结构

时间:2013-01-23 03:01:19

标签: database zend-framework

我想知道你们如何在Mysql http://shop.ccs.com中处理像这样的电子商务网站,以及产品,产品质量,颜色价格之间的所有相关性。我的是

  1. 表产品
    1. ID
    2. 名称
    3. 父母
  2. 表格大小
    1. ID
    2. id_product
    3. size_name
  3. 表颜色
    1. ID
    2. id_product
    3. 颜色

1 个答案:

答案 0 :(得分:0)

嗯..我想出了这个结构,希望有所帮助。应该有一个包含产品信息的主表。在这种情况下,它的产品ID,尺寸和颜色repec。其余表连接到主表

1.table products_id (master table)
     1.id- Primary Key
     2.id_product_size- References size.id (FK)
     3.id_product_color- References color.id (FK)

 2. table product_name
     1.product_id- References product_id.id(FK)
     2.name
     3.parents

 3.table size 
     1.id- Primary Key
     2.size_name
     3.quantity

 4.table color 
     1.id- Primary Key
     2.colors
     3.quantity