I am developing a very personal project and I have doubts about the design of the database and I don't know if the way I have planned it is correct or not.
As a first note, I need a database to control the times of the participants during an event which can be divided into several stages.
Starting from that first note, the minimum tables you would need would be:
EVENTS (id, name, start_date, end_date, location.....)
STAGES (id, id_event, name, date............)
PARTICIPANTS (id, name, last name.....)
CATEGORIES (id, name.........)
SECONDARY TABLES
EVENT_CATEGORIES (id_event, id_category)
EVENT_PARTICIPANTS (id, id_participant, id_event)
PARTICIPANT_CATEGORIES (id_participant_event, id_category)
TIMES (id_participant_event, id_stage, start_time, end_time, time_inverted)
PENALTIES (id_participant_event, time)
I plan to do something like this with the tables, although if you see any improvement correction to be made, I would appreciate it if you told me.
All this will be to exploit it with Laravel and the MySQL database, what interests me is:
1.- An event can have one or several categories
2.- A participant can take in one or several categories, only in those that the event has assigned
3.- With the classification of each one of the stages, I want to calculate how many positions have advanced/regressed compared to the previous stage by participants.
4.- Not all categories have to complete the same number of stages (I don't know how to do this at the database level)
Any help, recommendation will be welcome.
Thank you :)