A tally of days missed vs. days logged is trivial (used to calculate an overall percentage). The number of days in the calendar is explicit.
Adding new entries to the calendar is tricky, in the event that:
The calendar grows in length.
New users are added.
Table has gaps (wherever log == NULL), making traversal slower than Option 1.
My question is this: Is there a way to either use Option 1 and somehow encode the number of missed logs, or is there some other way of storing the data that meets both requirements? I've tried using Option 2, although scaling has become quite a challenge. Thanks in advance for any advice.
( 4 months ago )
Here's a few cases to spoil both designs: Teachers get sick. Unions go on strike. Servers go down. Snow days happen.
Class happens when it happens regardless of what the syllabus says. So rather than pretend we know what the future holds, simply record events as they happen.
Instructor declares today is a class day
Student declares their attendance today
absences = class days - attendances
Advantage: design does not require use of confusing misleading non-descriptive nulls.