On Fri, 2 Jan 2004, Caroline Jen wrote:
> In case that a user has multiple roles; for example,
> John Dole is both author and editor,
>
> 1. I should have two rows for John Dole?
>
> John Dole author
> John Dole editor
>
> or. I should have only one row and use comma ',' to
>
> separate the roles?
>
> John Dole author, editor
>
> 2. How do I create the table for the second case (see
> below)?
>
> create table user_roles (
> user_name varchar(15) not null,
> role_name varchar(15) not null, varchar(15) null
> );
>
If the roles will not be very dynamic and could be hardcoded you might be
able to use the SET datatype which is described here:
http://www.mysql.com/doc/en/SET.html
If you will add/update/change/delete roles often, then you should go for
one of the other methods suggested instead, but if the roles are static,
this might work better for you.