--
-- Host: localhost    Database: rotiss_topchef
-- ------------------------------------------------------


--
-- Current Database: `rotiss_topchef`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `rotiss_topchef` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `rotiss_topchef`;

--
-- Table structure for table `chef`
--

CREATE TABLE `chef` (
  `chef_id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(45) NOT NULL,
  `last_name` varchar(45) NOT NULL,
  PRIMARY KEY (`chef_id`)
) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `chef`
--

INSERT INTO `chef` VALUES (1,'John','Tesar'),(2,'Elizabeth','Binder'),(3,'Micah','Fields'),(4,'Joshua','Valentine'),(5,'Jeffrey','Jew'),(6,'Kristen','Kish'),(7,'Carla','Pellegrino'),(8,'Kuniko','Yagi'),(9,'Tyler','Wiard'),(10,'Eliza','Gavin'),(12,'Bart','Vandaele'),(13,'Sheldon','Simeon'),(14,'Brooke','Williamson'),(15,'Danyele','McPherson'),(16,'Stefan','Richter'),(17,'Chris','Jacobsen'),(18,'Josie','Smith-Malave'),(11,'Chrissy','Camba');

--
-- Table structure for table `chef_stat`
--

CREATE TABLE `chef_stat` (
  `chef_stat_id` int(11) NOT NULL AUTO_INCREMENT,
  `week` int(11) NOT NULL,
  `chef_id` int(11) NOT NULL,
  `stat_id` int(11) NOT NULL,
  PRIMARY KEY (`chef_stat_id`),
  UNIQUE KEY `uq_week_chef_stat` (`week`,`chef_id`,`stat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=450 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `chef_stat`
--

INSERT INTO `chef_stat` VALUES (1,1,2,15),(2,1,2,16),(3,1,11,15),(4,1,11,16),(5,1,3,15),(6,1,3,16),(7,1,10,15),(8,1,10,20),(9,1,17,19),(10,1,5,1),(11,1,5,19),(12,1,5,16),(13,1,6,15),(14,1,6,16),(15,1,15,15),(16,1,15,20),(17,1,7,15),(18,1,7,16),(19,1,7,8),(20,1,16,19),(21,1,13,9),(22,1,13,13),(23,1,18,19),(24,1,1,9),(25,1,1,13),(26,1,4,15),(27,1,4,20),(28,1,12,19),(29,1,12,16),(30,1,9,15),(31,1,9,16),(32,1,14,19),(33,1,14,16),(34,1,8,9),(35,1,8,13),(157,2,8,7),(156,2,8,4),(155,2,8,1),(154,2,14,7),(153,2,14,10),(152,2,9,11),(151,2,9,4),(150,2,12,11),(149,2,12,10),(148,2,4,11),(147,2,4,10),(146,2,1,11),(145,2,1,10),(144,2,18,5),(143,2,18,4),(142,2,13,11),(141,2,13,4),(140,2,16,6),(139,2,16,10),(138,2,7,7),(137,2,7,2),(136,2,15,11),(135,2,15,10),(134,2,6,11),(133,2,6,10),(132,2,17,11),(131,2,17,3),(130,2,10,11),(129,2,10,10),(128,2,3,6),(127,2,3,10),(126,2,11,11),(125,2,11,10),(124,2,2,11),(123,2,2,3),(158,3,2,3),(159,3,2,7),(160,3,11,1),(161,3,11,4),(162,3,11,11),(163,3,11,18),(164,3,3,10),(165,3,3,11),(166,3,10,10),(167,3,10,7),(168,3,17,4),(169,3,17,6),(170,3,5,18),(171,3,6,2),(172,3,6,11),(173,3,6,8),(174,3,15,10),(175,3,15,11),(176,3,7,1),(177,3,7,4),(178,3,7,11),(179,3,7,18),(180,3,16,3),(181,3,16,11),(182,3,13,10),(183,3,13,11),(184,3,18,10),(185,3,18,11),(186,3,1,10),(187,3,1,5),(188,3,4,4),(189,3,4,6),(190,3,12,10),(191,3,12,11),(192,3,9,3),(193,3,9,7),(194,3,14,10),(195,3,14,11),(196,3,8,17),(262,4,8,18),(261,4,14,16),(260,4,14,19),(259,4,9,17),(258,4,9,16),(257,4,9,19),(256,4,9,1),(255,4,12,13),(254,4,12,15),(253,4,4,12),(252,4,4,19),(251,4,1,12),(250,4,1,19),(249,4,18,20),(248,4,18,15),(247,4,13,13),(246,4,13,15),(245,4,16,16),(244,4,16,19),(243,4,15,20),(242,4,15,15),(241,4,6,16),(240,4,6,15),(239,4,17,17),(238,4,17,16),(237,4,17,19),(236,4,17,1),(235,4,10,20),(234,4,10,15),(233,4,3,16),(232,4,3,15),(231,4,2,20),(230,4,2,15),(263,5,2,10),(264,5,2,11),(265,5,3,4),(266,5,3,7),(267,5,10,1),(268,5,10,4),(269,5,10,11),(270,5,10,18),(271,5,17,17),(272,5,6,3),(273,5,6,11),(274,5,15,4),(275,5,15,11),(276,5,16,10),(277,5,16,6),(278,5,13,3),(279,5,13,11),(280,5,18,10),(281,5,18,11),(282,5,1,3),(283,5,1,11),(284,5,4,4),(285,5,4,6),(286,5,12,10),(287,5,12,7),(288,5,9,18),(289,5,14,2),(290,5,14,5),(291,6,2,3),(292,6,2,11),(293,6,3,4),(294,6,3,7),(295,6,17,17),(296,6,6,2),(297,6,6,5),(298,6,15,1),(299,6,15,4),(300,6,15,6),(301,6,15,18),(302,6,16,3),(303,6,16,11),(304,6,13,3),(305,6,13,6),(306,6,18,4),(307,6,18,11),(308,6,1,4),(309,6,1,11),(310,6,4,3),(311,6,4,7),(312,6,12,4),(313,6,12,11),(314,6,14,3),(315,6,14,7),(316,7,2,14),(317,7,2,6),(318,7,3,14),(319,7,3,5),(320,7,17,17),(321,7,6,15),(322,7,6,11),(323,7,16,15),(324,7,16,11),(325,7,13,19),(326,7,13,11),(327,7,18,19),(328,7,18,7),(329,7,1,9),(330,7,1,7),(331,7,4,19),(332,7,4,11),(333,7,12,1),(334,7,12,19),(335,7,12,7),(336,7,12,18),(337,7,14,9),(338,7,14,6),(339,8,2,4),(340,8,2,20),(341,8,3,10),(342,8,3,5),(343,8,17,17),(344,8,6,2),(345,8,6,16),(346,8,16,10),(347,8,16,20),(348,8,13,10),(349,8,13,12),(350,8,18,10),(351,8,18,16),(352,8,18,8),(353,8,1,1),(354,8,1,4),(355,8,1,16),(356,8,1,18),(357,8,4,3),(358,8,4,12),(359,8,14,3),(360,8,14,20),(361,9,2,4),(362,9,2,6),(363,9,3,1),(364,9,3,4),(365,9,3,11),(366,9,3,18),(367,9,17,17),(368,9,6,2),(369,9,6,11),(370,9,16,10),(371,9,16,6),(372,9,13,2),(373,9,13,7),(374,9,18,4),(375,9,18,11),(376,9,4,3),(377,9,4,7),(378,9,14,10),(379,9,14,5),(397,10,14,19),(390,10,17,18),(395,10,18,19),(394,10,13,2),(391,10,6,1),(393,10,16,9),(389,10,2,19),(396,10,4,9),(392,10,6,17),(398,11,2,3),(399,11,2,7),(400,11,6,17),(401,11,16,4),(402,11,16,5),(403,11,13,3),(404,11,13,11),(405,11,18,1),(406,11,18,4),(407,11,18,11),(408,11,18,18),(409,11,4,2),(410,11,4,7),(411,11,14,4),(412,11,14,6),(413,12,2,3),(414,12,2,11),(415,12,6,17),(416,12,16,1),(417,12,16,4),(418,12,16,11),(419,12,16,18),(420,12,13,4),(421,12,13,5),(422,12,4,3),(423,12,4,11),(424,12,14,2),(425,12,14,11),(426,13,2,1),(427,13,2,4),(428,13,2,7),(429,13,2,18),(430,13,6,17),(431,13,13,10),(432,13,13,5),(433,13,4,10),(434,13,4,7),(435,13,14,2),(436,13,14,6),(437,14,6,17),(438,14,13,10),(439,14,4,1),(440,14,4,4),(441,14,4,18),(442,14,14,2),(443,15,13,1),(444,15,13,4),(445,15,14,2),(446,15,6,2),(448,16,14,1),(449,16,6,2);

--
-- Table structure for table `draft_pick`
--

CREATE TABLE `draft_pick` (
  `draft_pick_id` int(11) NOT NULL AUTO_INCREMENT,
  `round` int(11) NOT NULL,
  `pick` int(11) NOT NULL,
  `team_id` int(11) NOT NULL,
  `chef_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`draft_pick_id`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `draft_pick`
--

INSERT INTO `draft_pick` VALUES (1,1,1,4,5),(2,1,2,2,13),(3,1,3,3,1),(4,1,4,1,8),(5,2,1,4,14),(6,2,2,1,12),(7,2,3,3,2),(8,2,4,2,3),(9,3,4,4,4),(10,3,2,2,11),(11,3,1,3,16),(12,3,3,1,6),(13,4,1,1,17),(14,4,3,3,15),(15,4,2,2,10),(16,4,4,4,18),(17,5,1,4,9);

--
-- Table structure for table `pick`
--

CREATE TABLE `pick` (
  `pick_id` int(11) NOT NULL AUTO_INCREMENT,
  `week` int(11) NOT NULL,
  `pick_number` int(11) NOT NULL,
  `team_id` int(11) NOT NULL,
  `chef_id` int(11) DEFAULT NULL,
  `record` enum('W','L') DEFAULT NULL,
  `points` float DEFAULT NULL,
  PRIMARY KEY (`pick_id`),
  UNIQUE KEY `uq_week_picknum` (`week`,`pick_number`),
  UNIQUE KEY `uq_week_chef_record` (`week`,`chef_id`,`record`),
  UNIQUE KEY `uq_week_team_record` (`week`,`team_id`,`record`)
) ENGINE=MyISAM AUTO_INCREMENT=169 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pick`
--

INSERT INTO `pick` VALUES (1,1,1,1,15,'L',2),(2,1,2,3,9,'L',1),(3,1,3,2,7,'L',-2),(4,1,4,4,12,'L',-2),(5,1,5,4,1,'W',2.5),(6,1,6,2,13,'W',2.5),(7,1,7,3,14,'W',0),(8,1,8,1,2,'W',0),(9,2,1,4,6,'W',0),(10,2,8,4,10,'L',0),(11,2,4,1,1,'W',0),(12,2,5,1,7,'L',0),(13,2,3,3,9,'L',0),(14,2,6,3,12,'W',0),(15,2,2,2,8,'W',0),(16,2,7,2,18,'L',0),(48,3,5,3,14,'W',0),(47,3,4,3,10,'L',0),(46,3,6,1,13,'W',0),(45,3,3,1,9,'L',0),(44,3,7,2,18,'L',0),(43,3,2,2,1,'W',0),(42,3,8,4,15,'L',0),(41,3,1,4,6,'W',5),(49,4,1,2,9,'L',4),(50,4,8,2,4,'W',0),(51,4,2,4,13,'W',0),(52,4,7,4,17,'L',4),(53,4,3,1,2,'W',0),(54,4,6,1,10,'L',0),(55,4,4,3,18,'L',0),(56,4,5,3,16,'W',0),(72,5,5,3,4,'L',0),(65,5,1,2,13,'W',0),(71,5,4,3,2,'W',0),(66,5,8,2,15,'L',0),(70,5,6,4,10,'L',4),(67,5,2,1,18,'L',0),(69,5,3,4,4,'W',0),(68,5,7,1,1,'W',0),(73,6,1,2,15,'L',4),(74,6,8,2,6,'W',4),(75,6,2,1,18,'L',0),(76,6,7,1,13,'W',0),(77,6,3,3,12,'L',0),(78,6,6,3,2,'W',0),(79,6,4,4,1,'W',0),(80,6,5,4,2,'L',0),(81,7,1,1,18,'L',0),(82,7,8,1,2,'W',0),(83,7,2,2,13,'W',0),(84,7,7,2,12,'L',3),(85,7,3,4,3,'L',0),(86,7,6,4,14,'W',1.5),(87,7,4,3,1,'W',1.5),(88,7,5,3,4,'L',0),(89,8,1,1,18,'L',0),(90,8,8,1,1,'W',0),(91,8,2,2,13,'W',0),(92,8,7,2,3,'L',0),(93,8,3,4,6,'W',3),(94,8,6,4,16,'L',0),(95,8,4,3,4,'L',0),(96,8,5,3,16,'W',0),(97,9,1,1,6,'W',3),(98,9,8,1,4,'L',0),(99,9,2,2,18,'L',0),(100,9,7,2,13,'W',3),(101,9,3,3,3,'L',3),(102,9,6,3,2,'W',0),(103,9,4,4,2,'L',0),(104,9,5,4,4,'W',0),(105,10,1,1,18,'L',0),(106,10,8,1,4,'W',0),(107,10,2,2,4,'L',0),(108,10,7,2,13,'W',2),(109,10,3,3,14,'L',0),(110,10,6,3,16,'W',0),(111,10,4,4,6,'W',0),(112,10,5,4,16,'L',0),(113,11,1,1,18,'W',0),(114,11,8,1,13,'L',0),(115,11,2,3,18,'L',2),(116,11,7,3,2,'W',0),(117,11,3,2,16,'L',0),(118,11,6,2,13,'W',0),(119,11,4,4,14,'W',0),(120,11,5,4,2,'L',0),(121,12,1,1,14,'W',2),(122,12,8,1,13,'L',0),(123,12,2,2,16,'L',2),(124,12,7,2,4,'W',0),(125,12,3,3,4,'L',0),(126,12,6,3,16,'W',0),(127,12,4,4,13,'W',0),(128,12,5,4,2,'L',0),(129,13,1,1,4,'L',0),(130,13,8,1,4,'W',0),(131,13,2,3,14,'L',0),(132,13,7,3,2,'W',0),(133,13,3,2,2,'L',1),(134,13,6,2,13,'W',0),(135,13,4,4,13,'L',0),(136,13,5,4,14,'W',1),(137,14,1,1,NULL,NULL,NULL),(138,14,8,1,NULL,NULL,NULL),(139,14,2,3,NULL,NULL,NULL),(140,14,7,3,NULL,NULL,NULL),(141,14,3,2,NULL,NULL,NULL),(142,14,6,2,NULL,NULL,NULL),(143,14,4,4,NULL,NULL,NULL),(144,14,5,4,NULL,NULL,NULL),(145,15,1,1,NULL,NULL,NULL),(146,15,8,1,NULL,NULL,NULL),(147,15,2,3,NULL,NULL,NULL),(148,15,7,3,NULL,NULL,NULL),(149,15,3,2,NULL,NULL,NULL),(150,15,6,2,NULL,NULL,NULL),(151,15,4,4,NULL,NULL,NULL),(152,15,5,4,NULL,NULL,NULL),(153,16,1,1,NULL,NULL,NULL),(154,16,8,1,NULL,NULL,NULL),(155,16,2,3,NULL,NULL,NULL),(156,16,7,3,NULL,NULL,NULL),(157,16,3,2,NULL,NULL,NULL),(158,16,6,2,NULL,NULL,NULL),(159,16,4,4,NULL,NULL,NULL),(160,16,5,4,NULL,NULL,NULL),(161,17,1,1,NULL,NULL,NULL),(162,17,8,1,NULL,NULL,NULL),(163,17,2,3,NULL,NULL,NULL),(164,17,7,3,NULL,NULL,NULL),(165,17,3,2,NULL,NULL,NULL),(166,17,6,2,NULL,NULL,NULL),(167,17,4,4,NULL,NULL,NULL),(168,17,5,4,NULL,NULL,NULL);

--
-- Table structure for table `stat`
--

CREATE TABLE `stat` (
  `stat_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `points` int(11) NOT NULL,
  `abbreviation` varchar(3) NOT NULL,
  `short_name` varchar(16) NOT NULL,
  `ordinal` int(11) NOT NULL,
  PRIMARY KEY (`stat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `stat`
--

INSERT INTO `stat` VALUES (1,'Elimination Loser',0,'E','Eliminated',1),(2,'Elimination Winner Individual',5,'W','Elim Win Ind',2),(3,'Elimination Top Individual',3,'Ti','Elim Top Ind',4),(4,'Elimination Bottom Individual',0,'Bi','Elim Bot Ind',8),(5,'Quickfire Winner Individual',4,'Qi','QF Win Ind',10),(6,'Quickfire Top Individual',2,'QTi','QF Top Ind',12),(7,'Quickfire Bottom Individual',0,'QBi','QF Bot Ind',16),(8,'Cut themselves',-3,'C','Cut',18),(9,'Elimination Winner Team',3,'Wt','Elim Win Team',3),(10,'Elimination Middle Individual',1,'Mi','Elim Mid Ind',6),(11,'Quickfire Middle Individual',1,'QMi','QF Mid Ind',14),(12,'Quickfire Top Team',2,'QTt','QF Top Team',13),(13,'Quickfire Winner Team',3,'Qt','QF Win Team',11),(14,'Elimination Top Team',2,'Tt','Elim Top Team',5),(15,'Elimination Middle Team',1,'Mt','Elim Mid Team',7),(16,'Quickfire Middle Team',1,'QMt','QF Mid Team',15),(17,'Last Chance Kitchen Winner',1,'L','LCK Winner',19),(18,'Last Chance Kitchen Loser',0,'X','LCK Loser',20),(19,'Elimination Bottom Team',0,'Bt','Elim Bot Team',9),(20,'Quickfire Bottom Team',0,'QBt','QF Bot Team',17);

--
-- Table structure for table `team`
--

CREATE TABLE `team` (
  `team_id` int(11) NOT NULL AUTO_INCREMENT,
  `team_name` varchar(45) NOT NULL,
  `abbreviation` varchar(10) NOT NULL,
  PRIMARY KEY (`team_id`),
  UNIQUE KEY `uq_team_name` (`team_name`),
  UNIQUE KEY `uq_abbr` (`abbreviation`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `team`
--

INSERT INTO `team` VALUES (1,'headcheese sandwich','kurt'),(2,'Duck Confit','christine'),(3,'glenn\'s team','glenn'),(4,'hockey puck halibuts','kellyroger');

--
-- Table structure for table `team_chef`
--

CREATE TABLE `team_chef` (
  `team_chef_id` int(11) NOT NULL AUTO_INCREMENT,
  `team_id` int(11) NOT NULL,
  `chef_id` int(11) NOT NULL,
  PRIMARY KEY (`team_chef_id`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `team_chef`
--

INSERT INTO `team_chef` VALUES (1,1,8),(2,1,12),(3,1,6),(4,1,17),(5,2,13),(6,2,3),(7,2,11),(8,2,10),(9,3,1),(10,3,2),(11,3,16),(12,3,15),(13,4,5),(14,4,14),(15,4,4),(16,4,9),(17,4,18);


