This is a discussion on How to store a schedule within the MySQL Database forums, part of the Database Forums category; I'm trying to store schedules for student's work schedules. I cannot seem to come up with a good ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm trying to store schedules for student's work schedules. I cannot
seem to come up with a good design of the data though. The biggested problem is that the students can work any number of shifts in a given day, so storing start and end times as two fields, or even multiple sets as two fields is not really an option. Currently the day is broken into 15 min increments and a series of 1's and 0's is scattered through a 64 character string to indicate when they work. This is horribly inefficent when trying to use the schedule to calculate anything though. Surely I'm missing some obvious or well known way to store this kind of information. Any ideas or suggestions would be welcome. |
|
|||
|
rfusca@gmail.com wrote:
> I'm trying to store schedules for student's work schedules. I cannot > seem to come up with a good design of the data though. The biggested > problem is that the students can work any number of shifts in a given > day, so storing start and end times as two fields, or even multiple > sets as two fields is not really an option. Currently the day is > broken into 15 min increments and a series of 1's and 0's is scattered > through a 64 character string to indicate when they work. This is > horribly inefficent when trying to use the schedule to calculate > anything though. Surely I'm missing some obvious or well known way to > store this kind of information. Any ideas or suggestions would be > welcome. > Why isn't storing start and end times as two fields an option? Using a TIMESTAMP type you even have the date in there. Or you can keep the date as a third column (and the student id as the fourth). -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
== Quote from rfusca (rfusca@gmail.com)'s article
> I'm trying to store schedules for student's work schedules. I cannot > seem to come up with a good design of the data though. The biggested > problem is that the students can work any number of shifts in a given > day, so storing start and end times as two fields, or even multiple > sets as two fields is not really an option. Currently the day is > broken into 15 min increments and a series of 1's and 0's is scattered > through a 64 character string to indicate when they work. This is > horribly inefficent when trying to use the schedule to calculate > anything though. Surely I'm missing some obvious or well known way to > store this kind of information. Any ideas or suggestions would be > welcome. you don't need to do any of that stuff. just divide up the whole day by 15 min. intervals and create a column for each one of them. then if the kid works in say period 5, update it with a 'y' or something like that. |
|
|||
|
rfusca@gmail.com wrote:
> I'm trying to store schedules for student's work schedules. I cannot > seem to come up with a good design of the data though. The biggested > problem is that the students can work any number of shifts in a given > day, so storing start and end times as two fields, or even multiple > sets as two fields is not really an option. Currently the day is > broken into 15 min increments and a series of 1's and 0's is scattered > through a 64 character string to indicate when they work. This is > horribly inefficent when trying to use the schedule to calculate > anything though. Surely I'm missing some obvious or well known way to > store this kind of information. Any ideas or suggestions would be > welcome. Why would you want to have a schedule for a schedule? |