2013-01-23 53 views
2

我想知道你是如何处理这样一个电子商务网站,如Mysql http://shop.ccs.com与产品,产品质量,尺寸,颜色价格之间的所有相关性。我的是电子商务网站的最佳数据库结构

  1. 表产品
    1. ID
    2. 父母
  2. 表大小
    1. ID
    2. id_product
    3. 大小_NAME
  3. 表颜色
    1. ID
    2. id_product
    3. 颜色
+0

你想要一个数据库模型? –

+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 
+0

那么在这种情况下,表格必须将id_product_category添加到products_id主表中,例如鞋子或T恤等类别,那么对吗? –

+0

是的,听起来不错 –

相关问题