bookmark - Lists Of Users, Etc In Tables

Lists Of Users, Etc In Tables

 
 Discussion by FirefoxRocks with 3 Replies.
 Last Update: April 12, 2009, 6:15 pm
 
bookmark - Lists Of Users, Etc In Tables  
    
free web hosting
 
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).

Sun Apr 12, 2009    Reply    New Discussion   


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.

Sun Apr 12, 2009    Reply    New Discussion   

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.

Sun Apr 12, 2009    Reply    New Discussion   

QUOTE (FirefoxRocks)

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.
Link: view Post: 135989

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

Sun Apr 12, 2009    Reply    New Discussion   


Quickly Post to Lists Of Users, Etc In Tables  w/o signup Share Info about Lists Of Users, Etc In Tables  using Facebook, Twitter etc. email your friend about Lists Of Users, Etc In Tables Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Best database How to decide  Best database How to decide (12) (3) Connecting To Mysql Databse   Connecting To Mysql Databse