There are four pieces of clothing, such as trousers, coats, underwear, and so, and each item has a different color. for example, the trousers are black, blue, and white. {code ...} then the size of each item is divided into men and women. XXLXXL female is s (a code smaller than X). XXL also requires the database of different properties of each item... there are four clothes, such as trousers, coats, underwear, and so.
Then each item has a different color.
For example, the trousers are black, blue, and white.
White, brown, red, underwear, black, white, pink, so, navy blue
Then each item is divided into male and female
Size: Male X XL XXL
Female: s (one code smaller than X) X XL
The inventory of different properties of each item is also required.
How to design such a table? could you please give me some advice on designing a database?
Reply content:
There are four clothes, such as trousers, coats, underwear, and so.
Then each item has a different color.
For example, the trousers are black, blue, and white.
White, brown, red, underwear, black, white, pink, so, navy blue
Then each item is divided into male and female
Size: Male X XL XXL
Female: s (one code smaller than X) X XL
The inventory of different properties of each item is also required.
How to design such a table? could you please give me some advice on designing a database?
Hope this article can help you, http://www.cnblogs.com/mmmjia...
Color and size for attributes
Color Table color id color value size table size id size inventory Table Product id color id size id inventory price
Attribute is not fixed
Attribute category table Category id category name attribute table attribute id category id attribute name inventory table product id attribute id (separated by commas) inventory price
Entity-attribute-value model (EAV model)
The first two tables are the product table + product attribute table.
There is a one-to-many relationship between a commodity table and an attribute table.
Therefore, the product table stores some fixed attributes, such as the total inventory of the product name, the remaining inventory, and so on, depending on the specific situation, such as the trousers and coats you mentioned.
The attribute table stores the inventory of the current attribute, such as the color and size.
Do you have any ideas?