E-commerce website database product Table Design Scheme

Source: Internet
Author: User

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

Related Article

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.