I was just handed a project to modify a school site for class registration. The current system is designed for each class to run one time per week, but I need to change things so that a class can occur on one or more nights per week. I am struggling with finding an efficient method to relate each of the classes, and allow the customers to view and select a single class when registering for the series.
My first thought is to add another field (groupid) that can hold a unique value to tie corresponding classes together. Looking at queries to sort this method is difficult, because if I sort by day-of-week followed by groupid (for display, class selection, etc), then the classes will be separated. Sorting by groupid then day-of-week produces a non-chronological order, which doesn’t work either. Is there a way to move the classes together groupid after sorting, but not affect the sorted date?
My second thought was to modify the table to support multiple classes per row. This would be the easier method, but less flexible, and even more problematic if the classes don’t run at the same time of the week.
Anyway, I’m a little lost, and would appreciate any feedback on design, and/or a query to help with my sort problem.
Thanks!
A class is a single entity regardless of how many days it meets in a given week. Create a Schedule table. It would include a FK_ClassID and ScheduleDate. If it meets three days in a week, it would have three records. This way, a student could schedule multiple classes, but check to make sure they do not over-lap on the same day of the week.