0
I have doubts about the structure of the database for a frequency system. I thought of two structures and when doing a search I saw that both exist and are used in different systems.
1 - The first I have a table frequencia
where I have the columns id_aluno
and id_reuniao
.
In this structure I keep only the members present, and not present will not be recorded.
2 - The second I have a table frequencia
where I have the columns id_aluno
, id_reuniao
and type
.
In this structure I keep as many present as absent, and this defined by the field tipo
where 0 = ausente
and 1 = presente
.
In a future report I will list all members and mark the days that they were present. This report will be for the two structures.
It will have the following model:
Membro Dia Dia Dia Dia
5 8 12 30
1 - João P A A P
1 - Maria P P P P
The days columns are the days of a meeting in a report where I choose data inicial
and data final
So it doesn’t follow a pattern. You can have months with just one meeting or many.
I’ll make a select
to list all members and for each member one select
of the meeting days of the break.
Assuming the first structure make test if the student exists on the day of the meeting. If yes mark as present if not mark as Absent.
Assuming the second structure I will make a select
of each member and of each member select
testing the field tipo
.
My question is: Which of the following structures will I have the most agility and ease to generate reports? Or if they have some structure more suitable for this type of system
Definitely the first option is the most indicated.
– Pantoja