January 4th, 2013, 10:37 AM
-
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
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
January 4th, 2013, 06:39 PM
-