From: Suresh Kumar R <[EMAIL PROTECTED]>
> I want to have the absentee list of students per hour_of_day
per day for a week, done for the entire course.
>
> One possibility I thought was to create a table with date and
each hour of the day as columns, then each cell would have to
have variable number of student roll nos who are absent for that
particular hour and I dont know how I can enter an array of
numnbers.
I think the best method to deal with this is just have a single
table containing :
student_id int
hour_of_day int
day_of_week int
week_of_course int
One assumes a student is present for all classes.
If a student is absent, an entry is made in the table, recording
the student's number, and the time/day/week they are absent.
It is more elegant to record the date using a date field, but it
will complicate your subsequent select queries, so I would use
the above design in your case.
This has the added advantage of only storing data by exception.
Russ.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php