var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Help in database design - users / extended profiles
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.
- 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.
- A table for all users (including persons, schools, pubs, and shops)
- 4 tables for each extended profile..
What do you think?
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!
Originally Posted by gogo167
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?)
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.
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.
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?