SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    standard data model for ecommerce?

    I know every ecommerce database schema is difference. But is there a typical data model we can follow? I just do not want to reinvent the wheel and want to get a semi-standard data model to jump start my database design.

    To be a little specific about my current challenge:

    1. how to classify one product into multiple categories.
    2. how to handle different set of product specifications, should I create a separate table for each type of products, such as tblElectronics, tblClothes, tblBooks, etc.

    Any references are welcome. Thanks.

  2. #2
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Pittsburgh, Los Angeles
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. how to classify one product into multiple categories.
    Have a category table and product table and then a table "inbetween" them with the form:

    category_product
    product id
    category id

    So for each product/category combo you'll have an entry in this table.

    2. how to handle different set of product specifications, should I create a separate table for each type of products, such as tblElectronics, tblClothes, tblBooks, etc.
    Often product specifications can be pinned to the categories they appear in...if not just make a product types table. Each product will then have a foreign key that points to the product type its a part of.

  3. #3
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a category table and product table and then a table "inbetween" them with the form:

    category_product
    product id
    category id
    Thanks, this will work. Creating a multi-to-multi relationship looks like to be the only option.

    Often product specifications can be pinned to the categories they appear in...if not just make a product types table. Each product will then have a foreign key that points to the product type its a part of.
    Can you give more details on this? How to "pin it to categories"? If I give a product_type_id foreign key to a product, this only helps to identify what type the product belongs to. I still do not know how to store product specifications. Can you show me a schema example to store product specifications? Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •