Need suggestions for DB tables
Posted: Wed May 24, 2006 10:57 pm
I originally posted a question about this in the PHP Code forum, but later realized it belongs here. My apologies to the community.
So, here's the deal. I'm trying to gather some ideas about how best to build the following project for a high school web site:
Post the current day's bell schedule with the current period highlighted. The issues involved are 7 different bell schedules plus weekends and holidays with no bell schedules.
The specific dates for each bell schedule are known in advance, but how should I put everything in a database? One table for the various bell schedules and one for the dates on which each bell schedule is used? That part seems like the natural way to go. But the problem is how to I efficiently cross reference the two tables to determine which bell schedule to use?
Here's what I've formulated in my head so far for the table of dates -- Just two columns like this:
date | bell_schedule
The first query would select everything where the date column matches today's date. If there is a match, then a second query selects the specific bell schedule pulled from the first query. If there is no match, then it must be a non-school day and no bell schedule applies.
How does this sound for a start? Any ideas about how to make it more efficient than I've described?
Thanks in advance.
So, here's the deal. I'm trying to gather some ideas about how best to build the following project for a high school web site:
Post the current day's bell schedule with the current period highlighted. The issues involved are 7 different bell schedules plus weekends and holidays with no bell schedules.
The specific dates for each bell schedule are known in advance, but how should I put everything in a database? One table for the various bell schedules and one for the dates on which each bell schedule is used? That part seems like the natural way to go. But the problem is how to I efficiently cross reference the two tables to determine which bell schedule to use?
Here's what I've formulated in my head so far for the table of dates -- Just two columns like this:
date | bell_schedule
The first query would select everything where the date column matches today's date. If there is a match, then a second query selects the specific bell schedule pulled from the first query. If there is no match, then it must be a non-school day and no bell schedule applies.
How does this sound for a start? Any ideas about how to make it more efficient than I've described?
Thanks in advance.