javascript-php Commodity SKU Table How to design

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.