Bluehost.com Web Hosting $6.95

How to store a schedule

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2007
rfusca@gmail.com
 
Posts: n/a
Default How to store a schedule

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.

Reply With Quote
  #2 (permalink)  
Old 04-24-2007
Jerry Stuckle
 
Posts: n/a
Default Re: How to store a schedule

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
==================
Reply With Quote
  #3 (permalink)  
Old 04-24-2007
lark
 
Posts: n/a
Default Re: How to store a schedule

== 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.
Reply With Quote
  #4 (permalink)  
Old 04-24-2007
Paul Lautman
 
Posts: n/a
Default Re: How to store a schedule

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?


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0