Modeling for student attendance

Asked

Viewed 851 times

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

1 answer

1


I believe that the most recommended option would be to choose the first option to create a table of presenca, in which you record only those present at each meeting, relating id_aluno and id_reuniao.

At the time of generating the report you know who has no record of presence was absent.

This way you save memory by having fewer records, and also by having one less column in the table presenca.

  • Definitely the first option is the most indicated.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.