1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    Smile Problems arise when designing database for ecommerce

    Hi guys, first of all i dont know if it appropriate to post such topic.. But please help me out.
    So im a newbie in database design, and i want to have a practice.
    Then im thinking about practicing to make fashion online shop website(it will sell shoes, t-shirt, shirt, accesories, etc)

    So first of all i design my database for customers, products, and orders, i come up with 5 tables:

    1. customers
    • customer_id
    • email
    • password
    • first_name
    • last_name
    • registration_date

    2. products
    • product_id
    • type_id (refers to type table)
    • price

    3. type
    • type_id
    • name
    • description

    4. order_log
    • order_log_id
    • order_description_id (refers to order_description table)
    • customer_id (refers to customer table)

    5. order_description
    • order_description_id
    • product_id (refers to product_id)
    • quantity
    • price
    • date

    so after seeing my own design, im thinkin "Oh my God, for type like shoes/t-shirt/shirt they will have a size!, but accesories dont" the questions are:

    1. should i add 1 more table like product_description? so in the product table, there will be product_description_id. If the product_description_id is 0, then it doesnt have any more description like size, but if its not 0 then it has..

    2. i find that my database design a bit ermm awkawrd.. can u guys give some tips to optimize it?

    thx for reading the long post! i really appreciate it, i dont have any computer backgrounds nor computer education, im an accountant student whose wanted to learn web + database, please do support
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Toronto Canada
    Rep Power

IMN logo majestic logo threadwatch logo seochat tools logo