Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
-none-

-none-

2007-10-10       - By Ramsey, Robert L

 Back
Hi,

I'm looking for a "best practices" way of creating tables to store both
one time and regularly repeating events.  These are classes, so for the
most part the have a regularly recurring time, but we do have some one
off events.  For example, let's say the following:

Class-A Mon,Wed,Fri 8-9 from August 20th-December 5th
Class-B Mon,Wed,Fri 9:10-10:10 from August 20th-December 5th
Class-C Tues,Thurs 10:30-12 from August 20th-December 5th
Class-D Wed,Thurs,Friday  1-2 from August 20th-December 5th
Class-E Tues,Thurs 8-9 from September 15th-January 15th
Event-F Thursday, November 8th, 12:30-3

I could have 1 table that had Name, Start_time, Stop_time and have one
entry for every single class and event.  That is a simple way to design
the table, but it seems like there's lots of needless duplication.
There are going to be 50+ entries for Class-A, one for each day it
meets.

It seems like there ought to be a way to use something like the ical
recurring event format to set things up so that there's 1 entry for each
event and that includes the recurrence.

The only other way I could think of to do it would be to duplicate the
cron format and have a table like this:

Name, start_day, start_datetime, stop_day, stop_datetime,

'Class-A', '1,3,5','2007-08-20 08:00:00', '2007-12-05 09:00:00'
'Class-D', '3,4,5','2007-08-20 13:00:00', '2007-12-05 14:00:00'

And then parse everything, but that seems resource intensive too.

Any suggestions for the best way to handle this?

Thanks,

Bob


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many things went on at Unseen University and, regrettably,
teaching had to be one of them. The faculty had long ago
confronted this fact and had perfected various devices for
avoiding it. But this was perfectly all right because,
to be fair, so had the students.
    Terry Pratchett Interesting Times
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@(protected)