so iam create a ecommerce base site. where user can buy stuff. i need some help with coming up a good database structures. so far i got 5 tables.

here is what iam thinking:
"user" table to keep track of users
"user_info" table to keep there detial inforamtion
"billing" table if they want to buy a item
"item" table info about item
"cart" table - not sure about this one.

-------
user
-------
user_id 
user name
password


-------
user_info
-------
user_info_id
user id
item_brought    //int array?
first_name
last_name
dob

-----------
item
----------
item_id
item_name
item_des
...


--------
billing
-------
billing_id
user_id
email
area_code  primary_phone
street_address
apt, suite, bldg.(optional)
zipcode
country
state
city

----------
cart
--------
cart_id
user_id
Quantity
color
size

let me know if i could add more tables or if there is a better way to create tables.

Recommended Answers

All 6 Replies

Member Avatar for LastMitch

@hwoarang69

i need some help with coming up a good database structures. so far i got 5 tables.

Are you kidding? Gosh, you been on Daniweb for a while and you post so many questions. But this one I can't believe you asking this question. You can't write a query for this plus creating a table?

But this one I can't believe you asking this question. You can't write a query for this plus creating a table?

I don't think they want the code to do queries, they are just asking on an opinion if the table structure they came up with was a good one or not.

Personally I would not use the cart table unless you want to save a cart so it's available to the user on a different PC, I would handle that with cookies.

I would also add an orders table that would keep a record of all orders so a user can view their previous orders and for record keeping.

You can't write a query for this plus creating a table?

next time read before posting a comment. :)

commented: I read you comment very closely -2

I don't think there is a need to separate the two user tables. I am not sure what you mean by "item_brought //int array?".

Member Avatar for LastMitch

@hwoarang69

i need some help with coming up a good database structures. so far i got 5 tables.

You never mention any suggestions or opinion?

next time read before posting a comment. :)

I did. I read it very carefully. English is my primary language so I understand. If English is not your primary language then mention it, almost all your threads that you created is in broken English. So rather then tell me to read it carefully maybe you can write your sentence clearly so it would be easily follow.

@Lastmitch, in case you're wondering, I downvoted too. Even though English is not my primary language:

let me know if i could add more tables or if there is a better way to create tables.

That reads to me like a request for opinions on the structure. But perhaps it just does because English isn't my language.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.