Tom Crimmins wrote:
> user table:
> id (pk)
> name
> any other user info only dependant on the user
>
> group table:
> id (pk)
> name
> any other group info only dependant on the group
>
> usergroup table:
> user_id (pk)
> group_id (pk)
> any info specific to individual user/group combo
Yes, if I understand what you are saying here correctly, I considered this.
However, the problem is that the columns corresponding to "any info
specific to individual user/group combo" is not guaranteed to be
consistent across groups. Well, to be more precise, the type for each
column will be the same, but the number of required columns (call this
number N) will be different.
It is for this reason that it seemed necessary to have a separate table
per group.
Now, if I could decide what the maximum number of required columns would
be, then I could see using this design, but this is simply not possible.
I am, of course, limited by the maximum number of columns (call this
number X) allowed within a mySQL database. The required number of
columns for a particular group could be anywhere between 1 and X.
However, it just seemed like a bad idea to use that large of a table
when the vast majority of it would go unused and much of it would likely
never be used at all. But, perhaps I am wrong and it would simply not be
an issue.
I suppose it would be possible to dynamically size 'usergroup table'
based on the current max N across all groups. Basically, if N changes
for a particular group, look at the value of N for all groups, take the
max and size 'usergroup table' accordingly.
Is this what you would do?