Jump to content
xisto Community
FirefoxRocks

Lists Of Users, Etc In Tables

Recommended Posts

I'm wondering what the most efficient way of doing this is.I have a table with users in it, each user has a unique id.Now suppose I had a table with groups in it. Each user can join the group. I estimate that the maximum size of a group would be 100 users.How do I store the user IDs in the group table? Do I make a column called `members` and store them in a semicolon separated list? If so, how do I delete members?Then again, there might be other methods I've never even thought of so I'm open to ideas. If it helps, a user could join probably 10-15 groups (this could change).

Share this post


Link to post
Share on other sites

Of course you don't need to store the username in the group table, because there is already a table associating the userid to his name.I would like to know if each user is in a unique group ? Then, the table could have two colums, groupid and userid.

Share this post


Link to post
Share on other sites

No, the user can join more than 1 group.In another forum I was told to make a table that contains the user ID and the group ID.

Correct, in a relational model, a table with userid and groupid is the best way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.