Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi dear experts.
i want to build a simple social network .I'm currently working on the architecture
Now I've created the users table . but i can't understand relation between users table and profile table . ! Whether their relationship is 1 to 1?
Posted

How many profiles do you expect your users to have?

Is it one user, one profile?
Or one user, many profiles?
Or many users, one profile?

The answer to that question is the answer to yours...
 
Share this answer
 
Comments
Saeid.Babaei86 16-Feb-12 3:30am    
hi .
my profile table provide some fixed columns such as first name last name birthdate ,...
One user have one profile
OriginalGriff 16-Feb-12 3:41am    
Then that should answer your question...
Hi, you have one user table and one profile table.
one user has one profile and reference of user id into profile table

add Userid as primary key in user table - auto increamented field
use this field make foreign key in profile table and using join queries you can fetch all fields from both the tables.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900