Now there are four dresses, like pants, coats, underwear, socks.
Then each item has a color that doesn't work
Like the trousers have black blue and white
外套有 白色 棕色 红色 内衣有 黑色 白色
Then each item is divided into men and women.
Size for male X XL XXL
Female is s (smaller than x size) x XL
Also requires inventory of different attributes for each item
How do you design a table like this? Seek the guidance of the great God to design the database
Reply content:
Now there are four dresses, like pants, coats, underwear, socks.
Then each item has a color that doesn't work
Like the trousers have black blue and white
外套有 白色 棕色 红色 内衣有 黑色 白色
Then each item is divided into men and women.
Size for male X XL XXL
Female is s (smaller than x size) x XL
Also requires inventory of different attributes for each item
How do you design a table like this? Seek the guidance of the great God to design the database
Hope this article can help you, Http://www.cnblogs.com/mmmjia ...
Properties on color and size
颜色表颜色id 颜色值尺码表尺码id 尺码库存表产品id 颜色id 尺码id 库存 价格
property is not fixed
属性分类表分类id 分类名属性表属性id 分类id 属性名库存表产品id 属性id(多个逗号隔开) 库存 价格
Entity-Attribute-value model (EAV model)
First two tables can be the commodity table + Product attribute table
The commodity table and the attribute table are 1-to-many relationships
So the commodity table holds some fixed attributes, such as the total stock inventory of the product name, and so on, and so on, such as your pants jacket.
The property sheet saves such as what you said about the color size of the inventory under current properties.
I don't know if you have any ideas.