I’m trying to define a table to store student grades for a online report card. I can’t decide how to do it, though.
The grades are given by subject, in a trimestral period. Every trimester has a average grade, the total missed classes and a ‘recovering grade’ (I don’t know the right term in English, but it’s an extra test you take to try to raise your grade if you’re below the average), I also gotta store the year average and final ‘recovering grade’. Basically, it’s like this:
|1st Trimester |2nd Trimester |3rd Trimester Subj. |Avg. |Mis. |Rec |Avg. |Mis. |Rec |Avg. |Mis. |Rec |Year Avg. |Final Rec. Math |5.33 |1 |4 |8.0 |0 |7.0 |2 |6.5 |7.0 Sci. |5.33 |1 |4 |8.0 |0 |7.0 |2 |6.5 |7.0
I could store this information in a single DB row, with each row like this:
1tAverage | 1tMissedClasses | 1tRecoveringGrade | 2tAverage | 2tMissedClasses | 2tRecoveringGrade
And so on, but I figured this would be a pain to mantain, if the scholl ever decides to grade by bimester or some other period (like it used to be up until 3 years ago).
I could also generalize the table fields, and use a tinyint for flagging for which trimester those grades are, or if they’re the year finals. But this one would ask for a lot of subqueries to write the report card, also a pain to mantain.
Which of the two is better, or is there some other way? Thanks
You could try structuring it like this with your tables. I didn’t have all the information so I made some guesses at what you might need or do with it all.
TimePeriods:
Students:
Grading:
MissedClasses:
Classes: