【发布时间】:2010-05-25 10:55:10
【问题描述】:
我是数据库设计的新手,我想确保我做得很好。 请查看我的数据库设计的一部分:
我的基本购物车数据库设计:
//table that holds shopping cart items that customer choose(not press checkout and order //them)
**shopping_cart**
{
id (int)
product_id (int) fk
product_quantity (int)
customer_user_id (int) fk
}
//table that holds product order data in time of checkout.(i hold them because supplier //can change after time products attributes value add some attributes or delete and change //the price of product)
**order**
{
id (int)
product_id (int) fk
customer_user_id (int) fk
}
//table that connect order to attribute table for products attributes value in the moment //of checkout
**order_attributes**
{
id (int)
order_id (int) fk
attribute_id (int) fk
}
//main product table
**product**
{
id (int)
sku (int)
product_name (varchar)
supplier_user_id (int) fk
}
//connection table many to many
**product_attributes**
{
id (int)
product_id (int) fk
attribute_id (int) fk
}
//table that holds products attributes (price, weight, color + new attributes that user //will create)
**attribute**
{
id (int)
product_id (int) fk
attribute_name (varchar)
attribute_value(varchar)
}
谢谢你
【问题讨论】:
标签: mysql database database-design data-structures