Home  >  Article  >  Backend Development  >  For a mall, how should the product table and product attributes be designed better?

For a mall, how should the product table and product attributes be designed better?

WBOY
WBOYOriginal
2016-09-21 14:13:101873browse

My product is, for example, the iPhone 6s. The colors are champagne, silver, and gray. Different colors include 16G, 32G, and 64G.
You think it is color + version + product ID = one product. In this way, one product has multiple products. They share the product introduction details, etc. What is not shared is the product album, introduction and the like.
Is it better to do the above, or treat all color versions as one product ID.

Reply content:

My product is, for example, the iPhone 6s. The colors are champagne, silver, and gray. Different colors include 16G, 32G, and 64G.
You think it is color + version + product ID = one product. In this way, one product has multiple products. They share the product introduction details, etc. What is not shared is the product album, introduction and the like.
Is it better to do the above, or treat all color versions as one product ID.

Color and capacity are equal. It’s just a property of the product.
Product table + product attribute table should be enough.
The product attribute table includes attribute name (such as color) and attribute value (black).
The product list is simple. Some inherent attributes, such as inventory, price, etc.

Separate the two tables. One 6S corresponds to multiple attributes. If we don’t separate the other speeds and the like, it will feel too messy at first. For the product album, you can create a separate attachment table for easy management

Just figure out spu and sku

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn