Solution 1.
The product table contains all product attributes. Each attribute is represented by a field.
Solution 2.
Or use only one product table.
Different from solution 1, private attributes are set to a field Private_Attribute,
Multiple private attributes of each product are placed in this field and separated by a separator.
For example, a book is represented in the Private_Attribute field as follows:
Publisher | author | publication date
Solution 3;
Product table + Private Attribute Table + private attribute value table
The product table contains the public attributes of some products.
Set the name of a private attribute in a private attribute table, such as a publisher, author, or publication date.
The private property value table contains the private property values of each product.
For example:
Product table:
Product_id = 1; product_name = ajax practice
Private Attribute Table:
Attribute_id = 1; Attribute_name = Press
Attribute_id = 2; Attribute_name = author
Private property value table:
Id = 1; product_id = 1; Attribute_id = 1; Attribute_value = Tsinghua Press
Id = 2; product_id = 1; Attribute_id = 2; Attribute_value = foreigner
Solution 4;
A database is designed for each product of different types, such as a data table product_book of a book and an MP3 data table product_mp3.
Each design may have its own advantages and disadvantages, mainly depending on the application site
I mainly want to apply this to e-commerce, so there will be order operations at the same time.
This is a common method. We are always looking for a better solution. Solving...
Comments
My own opinion: Put all products in a table. Set independent fields for common attributes (those frequently queried.
Those that are not commonly used are included in a field. Use a large string. Fuzzy search is required (may be inefficient)
Turn: http://www.fleaphp.org/bbs/viewthread.php? Tid = 298