Quote:
|
Originally Posted by Pat Phelan
Is weekid a montonically increasing week counter?
It would help me a whole bunch to see your schema (the CREATE TABLE statement or statements) and two consecutive weeks worth of data for three or more teams.
|
Pat,
Yes, the week number is monotonically increasing. Thoughout the season there are 16 weekly polls, one in the preseason (1), Weeks 1-14 (2-15) and then the final rankings (16) after Bowls are played.
Here is the structure for the rankem table and the insert statements for 2 weeks of data.
CREATE TABLE `rankem_rank` (
`rankid` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL,
`teamid` smallint(3) unsigned NOT NULL,
`weekid` smallint(2) NOT NULL default '0',
`rank` smallint(2) NOT NULL default '0',
`points` smallint(2) NOT NULL default '0',
PRIMARY KEY (`rankid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
INSERT INTO `rankem_rank` VALUES(1, 1, 88, 1, 1, 25);
INSERT INTO `rankem_rank` VALUES(2, 1, 34, 1, 2, 24);
INSERT INTO `rankem_rank` VALUES(3, 1, 46, 1, 3, 23);
INSERT INTO `rankem_rank` VALUES(4, 1, 88, 2, 1, 25);
INSERT INTO `rankem_rank` VALUES(5, 1, 46, 2, 2, 24);
INSERT INTO `rankem_rank` VALUES(6, 1, 34, 2, 3, 23);
Here is the team table:
CREATE TABLE `rankem_team` (
`teamid` tinyint(3) unsigned NOT NULL auto_increment,
`team` varchar(255) NOT NULL,
`mascot` varchar(255) NOT NULL,
`conference` varchar(255) NOT NULL,
PRIMARY KEY (`teamid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=121 ;
INSERT INTO `rankem_team` VALUES(34, 'Georgia', 'Bulldogs', 'Southeastern');
INSERT INTO `rankem_team` VALUES(46, 'LSU', 'Tigers', 'Southeastern');
INSERT INTO `rankem_team` VALUES(88, 'Southern California', 'Trojans', 'Pacific-10');