i have little question database design :
let's have "group" (of users) table. in table there basic fields information group (creation date, name, etc) , field should contain list of users of group.
i have "users" table, contains information users (really?). table not linked group table because user not forced have group.
in group, user can "president" (only one) or "scrutineer" (several)
so in "group" table, there "president" field contains president user id. , need "scrutineer" field contain list of scrutineers ids.
i don't know how handle list. maybe store every id in 1 text field, separated character (';' or '-')...
making table seems strange, because it's little part of site.
how resolve this?
i don't know how handle list. maybe store every id in 1 text field, separated character (';' or '-')...
don't this. see is storing delimited list in database column bad?
making table seems strange, because it's little part of site.
that correct, normalised, way represent many-to-many relationship.
if user can in @ 1 group (a many-to-one relationship), could store group membership in users table (leaving column null if user not in group) , either flag in table whether membership of president or scrutineer, or else assume scrutineer unless president in groups table. however, in case i'd still tempted stick additional table , define unique constraint on user column.
Comments
Post a Comment