Quote:
| Originally Posted by shylender We are developing social networking project. we have to create different communities for Site. My question is whether we have to create seperate tables for different communities. Please help me. |
Not always. It depends more on your overall relational model for your database.
Although if I was doing it...I would probably make a table which contained the following:
Community ID - Unique Identifier (Primary Key)
Community Name - The name of this particular community
Also add in any other relevant columns for information about the each community.
Then I would have another table which would be used as a bridge between your Users and your Communities tables. It would look something like:
Community ID - The ID of the community the User is in.
User ID - The ID of that particular user
Put together this would make a composite primary key and it would keep track of all users and any communities they are a part of (example: one record could be User ID 1, Com ID 1, while another record could have User ID 1, Com ID 4, and another user record could be User ID 3, Com ID 1. This would show that User ID 1 is in Communities 1 and 4, and User ID 3 is in Group 1).
Again, this is entirely dependent on your overall database design, but it is more than likely the most appropriate route for keeping track of communities and what users are in them.