Jump to content

scheduling Table Design


mo

Recommended Posts

I have the following table defined for poker game schedules.

 

The table will be queried using keys venue ID, game type ID and day of the week from the main game table.

 

There can be more than one of the same game for the same venue on the same day just at different times or even at the same time. So, should I use an auto increment field as a key (as below) or just include start/end time as keys?

 

CREATE TABLE `game_schedule` (
  `sid` int(11) NOT NULL auto_increment,
  `venue_id` int(11) NOT NULL COMMENT 'Venue ID',
  `game_type_id` varchar(10) NOT NULL COMMENT 'Game ID',
  `day_of_week` int(1) NOT NULL COMMENT 'Day of The Week',
  `start_time` time NOT NULL COMMENT 'Start Time',
  `end_time` time NOT NULL COMMENT 'End Time',
  PRIMARY KEY  (`sid`,`venue_id`,`game_type_id`,`day_of_week`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Venue Games Schedule' AUTO_INCREMENT=1 ;

Link to comment
https://forums.phpfreaks.com/topic/208208-scheduling-table-design/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.