Bit of a carry on from this question here: Database design for school attendance system
I am currently doing something similar but have a few additional questions. So the school has approx 200 students but this is constantly changing. They attend for roughly 200 days and its required to keep the attendance data for 7 years. This is my create table statement here:
CREATE TABLE attendance (
studentID INTEGER REFERENCES students (studentID),
date DATE,
present BOOLEAN
);
My question is, is this the best way to create the table?
I haven't really done any direct database stuff from a UI before so my proposed solution was:
First a local variable that would use C# DateTime.Today function to get todays date; Another local variable which would get the StudentID from the UI; And then the attendance value which is a boolean, again set by the UI and stored as a 0/1;
All of these then combined into the Insert into SQL statement.
Is this the best way? Any tips or help would be appreciated thanks.
attendance
attribute likeabsence_reason
or something.present
column? Couldn't a lack of a row for a given student on a given day mean they're absent?