I wonder if it is possible to restrain users to insert duplicate registration records. For example some team is registered from 5.1.2009 – 31.12.2009. Then someone registers the same team for 5.2.2009 – 31.12.2009. Usually the end_date is not an issue, but start_date should not be between existing records start and end date
CREATE TABLE IF NOT EXISTS `ejl_team_registration` ( `id` int(11) NOT NULL auto_increment, `team_id` int(11) NOT NULL, `league_id` smallint(6) NOT NULL, `start_date` date NOT NULL, `end_date` date NOT NULL, PRIMARY KEY (`team_id`,`league_id`,`start_date`), UNIQUE KEY `id` (`id`) );
I would check it in the code df the program, not the database.