Having trouble wrapping my head around the right way to structure this...
I'm building an event management application with a judging function for a contest. There will be multiple rounds, each with multiple judges and multiple participants. Any given judge may judge in multiple rounds and any given participant may participate in multiple rounds. But from each round there will be only one score per judge per participant.
I've created the following tables:
- user
- user_id
- user_name
- user_role_id
- user_role
- user_role_id
- user_role_name
- user_role_desc
- round
- round_id
- round_name
- round_loc
- user_round (to join many-to-many users and rounds)
- user_id
- round_id
- score
- score_id
- score_value
- round_id
- user_id_judge
- user_id_participant
user_role defines judge, participant, admin, support, etc. I then have all users in one table with a role assigned - this is what's got me confused. When I define score for example this means I have to include 2 keys from the user table to define both judge and participant. Is there a problem in doing this I'm not thinking about? I was initially going to have separate judge and participant tables, but I thought my current structure was more in line with the "right way". What else am I not thinking of?