Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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