| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

02-07-12, 09:38
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 3
|
|
Help in database design - users / extended profiles
|
|
Hi!,
First, sorry for my english, is very bad. I hope you understand it.
My idea is build a simple social network with users and companies (Salsa Dance Schools, Pubs and Discos, and shoe shops for dancing).
The point is, shools, pubs and shops have a diferrent profile and they can do differents things. For example, Pubs can create events and Shops don't. Shops can upload products but Schools don't, etc.
I don't know how is the best way to transform this into a database design.
Option 1:
- A table for users
- A table for bussiness: Schools, Pubs and Shops (fields like user, pass, email...to login)
- 3 Tables for each bussiness extended profile.
Option 2:
- A table for all users (including persons, schools, pubs, and shops)
- 4 tables for each extended profile..
Option X?
What do you think?
Thanks!
|
|

02-13-12, 02:05
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 9
|
|
Hi, my English is also not good enough.
If I understand correctly, I'll prefer option 1, table seems much more break down and normalized.
Besides, the following issues are not essential, but may have a good start:
1) Email/Password should belongs to user personality (i.e. USER table), or the same user can have diff. identity for diff. society?
2) How many common fields in "Schools, Pubs and Shops"?
Say 20 fields only common in 2 fields, is it still valuable to use "extended profile" (1+3 tables), or just simply separate in 3 tables.
I'm also a beginner, hope experts here can give you some suggestions. 
|
|

02-13-12, 03:09
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 3
|
|
|
|
Quote:
Originally Posted by gogo167
Hi, my English is also not good enough.
If I understand correctly, I'll prefer option 1, table seems much more break down and normalized.
Besides, the following issues are not essential, but may have a good start:
1) Email/Password should belongs to user personality (i.e. USER table), or the same user can have diff. identity for diff. society?
2) How many common fields in "Schools, Pubs and Shops"?
Say 20 fields only common in 2 fields, is it still valuable to use "extended profile" (1+3 tables), or just simply separate in 3 tables.
I'm also a beginner, hope experts here can give you some suggestions. 
|
Thanks for your answer!
I think that create one table for each type is the best way in this case. 4 tables, users, shops, pubs and schools.
(What's your native language?)
|
|

02-13-12, 03:25
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 9
|
|
Hi Kitune, I use Chinese and living in HK.
Just one more suggestion:
- if your 3 tables only different in 1~2 fields, in the contrary, you may consider to put them into single table and limited to use some fields for diff. society.
|
|

02-13-12, 03:46
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 3
|
|
What do yo think about the pros and cons creating a 2 tables for users (user and profile) or one table (users, including the profile fields too).
I think the best and common option is one table for login (username, pass, email, etc.) and another for profile (age, country, ....), but I don't know why.
Thanks!
|
|

02-13-12, 04:08
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 9
|
|
If the user identity is unique in any of your application(i.e society), it's no reason to separate the table into two for simple application.
The benefit of using 2 tables is that, for example, you may have unlimited EmailAddress/Tel/... for the same user, just join them to the same USER ID.
Is that the point?
So are you also use Chinese?
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|