Forum Moderators: coopster
I've had 2 people suggest 2 different answers. One person uses sql server a lot and the other is a mysql guy.
SQL Server response:
Use 2 tables a USER and USER_TYPE (remove "type" index)
USERS: user_id, type_id. etc...
TYPES: type_id and type_name
Then just join on the type_id to get then type name
MySQL response:
Use 3 tables (maintain type index)
USERS: user_id, etc...
USER_TYPES: user_id, type_id
TYPES: type_id, type_name
Let User_Types create the relation between the 2 tables.
I was wondering why the mysql guy suggest this route as opposed to only 2 tables like the sql server guy? Would both work fine in mysql or is there something I missed?
--Nick
(and note - if you don't have any further details to record about the Types than its name then you don't actually need a table for it)