I'm not an expert in databases, so this is complex for me but maybe it's no for a lot of people. I have the following:
quiz
: Table which contains some quizzes
project
: Table which contains some projects
project_has_quiz
: A many-many relationship table project-quiz
team
: Table which contains some teams
event
: Table which contains some events (a project plus a date and some other fields)
event_has_team
: A many-many relationship table event-team
Now, I have to assign an order for the quizzes for each team in an event. For example:
Say you have 5 quizzes a
, b
, c
, d
, e
.
You create a project projectA
with quizzes a
, b
and c
.
You have two teams: teamA
and teamB
You create and event eventA
with projectA
and you relation it with teamA
and teamB
.
Now I have to put somewhere that eventA
with teamA
must have a quiz order a, b, c
and eventA
with teamB
must have a quiz order c, a, b
.
What is the best way to do this?
First idea I have is to build another table: event_has_team_has_quizOrder
, with a column quizOrder
having inserted through programming code a, b, c
and c, a, b
. But I don't think this is the most pure way to achieve this and that this surely have problems of denormalization.
Thank you very much.