--
-- Host: 0.0.0.0    Database: www_ne_cedecom_enquete
-- ------------------------------------------------------


--
-- Table structure for table `enquetes`
--

CREATE TABLE `enquetes` (
  `cod_enquete` int(11) NOT NULL AUTO_INCREMENT,
  `pergunta_enquete` varchar(255) NOT NULL,
  `ativa` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Mostra qual enquete está ativa no momento.',
  PRIMARY KEY (`cod_enquete`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `enquetes`
--

INSERT INTO `enquetes` VALUES (1,'Qual dos seguintes nomes você escolhe para o novo mascote do projeto Bocados de Gentileza?',0);

--
-- Table structure for table `enquetes_2`
--

CREATE TABLE `enquetes_2` (
  `cod_enquete` int(11) NOT NULL AUTO_INCREMENT,
  `pergunta_enquete` varchar(255) NOT NULL,
  `ativa` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Mostra qual enquete está ativa no momento.',
  PRIMARY KEY (`cod_enquete`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `enquetes_2`
--

INSERT INTO `enquetes_2` VALUES (1,'Qual dos seguintes nomes você escolhe para o novo mascote do projeto Bocados de Gentileza?',1);

--
-- Table structure for table `ip_votantes`
--

CREATE TABLE `ip_votantes` (
  `cod_ip` int(11) NOT NULL AUTO_INCREMENT,
  `num_ip` varchar(50) NOT NULL,
  `date_time` datetime DEFAULT NULL,
  `cod_enquete` int(11) NOT NULL,
  `cod_opcao` int(11) NOT NULL,
  PRIMARY KEY (`cod_ip`),
  UNIQUE KEY `num_ip-cod_enquete` (`num_ip`,`cod_enquete`),
  KEY `cod_enquete` (`cod_enquete`),
  KEY `cod_opcao` (`cod_opcao`),
  CONSTRAINT `ip_votantes_ibfk_1` FOREIGN KEY (`cod_enquete`) REFERENCES `enquetes` (`cod_enquete`) ON UPDATE CASCADE,
  CONSTRAINT `ip_votantes_ibfk_2` FOREIGN KEY (`cod_opcao`) REFERENCES `resp_` (`cod_opcao`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ip_votantes`
--

INSERT INTO `ip_votantes` VALUES (1,'150.164.63.245','2013-05-08 14:38:25',1,1),(2,'200.198.16.34','2013-05-08 14:40:12',1,4),(3,'186.206.138.157','2013-05-08 14:40:55',1,3),(4,'200.198.7.36','2013-05-08 14:42:00',1,5),(5,'150.164.80.89','2013-05-08 14:42:47',1,3),(6,'201.17.205.61','2013-05-08 14:43:19',1,5),(7,'189.107.132.21','2013-05-08 14:45:18',1,3),(8,'150.164.57.92','2013-05-08 14:45:25',1,3),(9,'150.164.19.108','2013-05-08 14:47:40',1,1),(10,'150.164.26.120','2013-05-08 14:52:59',1,1),(11,'201.29.72.140','2013-05-08 14:55:32',1,3),(12,'186.206.229.26','2013-05-08 14:57:47',1,1),(13,'187.20.151.199','2013-05-08 14:58:53',1,4),(14,'177.182.57.250','2013-05-08 14:59:59',1,4),(15,'150.164.117.52','2013-05-08 15:00:01',1,1),(16,'150.164.20.52','2013-05-08 15:01:43',1,4),(17,'150.164.147.128','2013-05-08 15:01:56',1,5),(18,'187.20.32.122','2013-05-08 15:02:40',1,4),(19,'150.164.195.236','2013-05-08 15:03:21',1,1),(20,'201.58.115.235','2013-05-08 15:03:41',1,1),(21,'189.59.165.156','2013-05-08 15:03:55',1,2),(22,'186.206.199.253','2013-05-08 15:05:43',1,5),(23,'186.244.106.221','2013-05-08 15:05:56',1,4),(24,'150.164.121.2','2013-05-08 15:07:11',1,5),(25,'177.182.31.115','2013-05-08 15:09:47',1,2),(26,'187.20.188.55','2013-05-08 15:10:51',1,5),(27,'150.164.30.6','2013-05-08 15:11:45',1,3),(28,'150.164.98.73','2013-05-08 15:15:26',1,3),(29,'187.71.17.96','2013-05-08 15:15:37',1,1),(30,'201.4.228.200','2013-05-08 15:18:41',1,2),(36,'187.71.25.97','2013-05-08 15:19:22',1,1),(37,'187.4.152.90','2013-05-08 15:19:44',1,1),(38,'187.104.18.1','2013-05-08 15:19:54',1,4),(40,'186.250.46.41','2013-05-08 15:22:08',1,5),(43,'150.164.71.43','2013-05-08 15:23:21',1,4),(44,'201.80.134.4','2013-05-08 15:23:59',1,3),(45,'201.54.208.4','2013-05-08 15:24:15',1,5),(49,'150.164.73.93','2013-05-08 15:26:52',1,3),(51,'150.164.63.65','2013-05-08 15:27:27',1,3),(56,'150.164.118.69','2013-05-08 15:33:01',1,3),(57,'150.164.85.66','2013-05-08 15:33:30',1,3),(60,'177.69.225.81','2013-05-08 15:37:46',1,4),(62,'150.164.127.110','2013-05-08 15:39:15',1,1),(63,'150.164.63.243','2013-05-08 15:43:18',1,3),(65,'177.86.200.2','2013-05-08 15:43:57',1,4),(66,'150.164.34.164','2013-05-08 15:46:14',1,4),(68,'150.164.107.217','2013-05-08 15:47:24',1,3),(75,'201.54.210.19','2013-05-08 15:53:15',1,5),(76,'189.115.127.20','2013-05-08 15:57:42',1,1),(77,'150.164.98.20','2013-05-08 15:58:09',1,3),(78,'150.164.77.106','2013-05-08 15:59:29',1,4),(79,'177.182.156.39','2013-05-08 16:02:42',1,3),(80,'187.20.41.64','2013-05-08 16:04:07',1,3),(81,'201.80.23.156','2013-05-08 16:04:16',1,2),(82,'150.164.98.103','2013-05-08 16:05:37',1,3),(83,'187.1.217.133','2013-05-08 16:10:59',1,2),(84,'150.164.55.233','2013-05-08 16:11:11',1,2),(85,'150.164.62.34','2013-05-08 16:11:40',1,4),(86,'177.182.174.101','2013-05-08 16:12:10',1,1),(87,'201.17.250.166','2013-05-08 16:13:08',1,2),(88,'179.236.46.243','2013-05-08 16:16:36',1,4),(89,'150.164.40.208','2013-05-08 16:18:41',1,5),(90,'201.54.209.16','2013-05-08 16:20:45',1,3),(91,'150.164.106.25','2013-05-08 16:23:19',1,1),(92,'187.20.191.99','2013-05-08 16:23:57',1,5),(93,'200.198.6.34','2013-05-08 16:28:29',1,4),(94,'177.159.202.138','2013-05-08 16:30:48',1,1),(95,'150.164.62.88','2013-05-08 16:32:51',1,3),(96,'201.80.148.173','2013-05-08 16:33:05',1,5),(97,'187.20.5.33','2013-05-08 16:36:50',1,4),(99,'150.164.74.147','2013-05-08 16:39:12',1,4),(100,'150.164.20.244','2013-05-08 16:42:52',1,1),(101,'189.83.222.124','2013-05-08 16:44:43',1,4),(102,'177.182.4.120','2013-05-08 16:45:01',1,5),(103,'201.80.146.190','2013-05-08 16:45:32',1,4),(104,'189.105.177.123','2013-05-08 16:51:19',1,2),(105,'177.182.138.226','2013-05-08 16:55:42',1,3),(106,'177.19.15.202','2013-05-08 16:57:18',1,3),(107,'189.9.20.121','2013-05-08 17:05:18',1,4),(109,'150.164.55.182','2013-05-08 17:07:56',1,4),(110,'150.164.108.7','2013-05-08 17:14:32',1,5),(111,'150.164.106.28','2013-05-08 17:16:14',1,2),(112,'150.164.114.37','2013-05-08 17:16:44',1,5),(114,'150.164.161.13','2013-05-08 17:21:53',1,4),(115,'187.104.19.184','2013-05-08 17:23:12',1,4),(116,'150.164.81.205','2013-05-08 17:24:34',1,4),(118,'187.20.245.108','2013-05-08 17:26:47',1,3),(122,'150.164.130.10','2013-05-08 17:30:13',1,5),(123,'201.39.4.15','2013-05-08 17:30:40',1,3),(125,'187.20.45.92','2013-05-08 17:31:40',1,4),(129,'200.159.21.42','2013-05-08 17:33:03',1,1),(132,'201.80.192.31','2013-05-08 17:35:01',1,4),(134,'187.20.39.239','2013-05-08 17:35:34',1,5),(145,'150.164.63.231','2013-05-08 17:43:44',1,3),(148,'186.213.67.13','2013-05-08 17:46:03',1,4),(150,'201.80.179.217','2013-05-08 17:49:19',1,1),(151,'187.20.227.231','2013-05-08 17:50:23',1,2),(152,'201.73.148.66','2013-05-08 17:50:48',1,2),(154,'201.58.111.33','2013-05-08 17:51:16',1,3),(156,'150.164.55.189','2013-05-08 17:52:43',1,5),(157,'150.164.127.24','2013-05-08 17:55:53',1,5),(158,'177.130.177.128','2013-05-08 18:03:37',1,3),(159,'150.164.98.72','2013-05-08 18:04:24',1,3),(160,'177.149.68.203','2013-05-08 18:05:12',1,2),(162,'177.177.115.238','2013-05-08 18:15:21',1,3),(163,'150.164.72.170','2013-05-08 18:19:51',1,4),(164,'150.164.201.59','2013-05-08 18:21:06',1,3),(165,'177.179.35.108','2013-05-08 18:23:03',1,4),(166,'150.164.166.193','2013-05-08 18:25:53',1,3),(167,'186.206.208.24','2013-05-08 18:42:11',1,4),(168,'150.164.98.58','2013-05-08 18:45:50',1,1),(170,'201.58.14.238','2013-05-08 18:48:20',1,5),(171,'189.90.241.154','2013-05-08 18:50:03',1,1),(172,'187.76.244.230','2013-05-08 18:54:08',1,1),(173,'201.62.201.44','2013-05-08 19:05:44',1,4),(174,'179.174.234.234','2013-05-08 19:10:29',1,3),(175,'187.20.165.125','2013-05-08 19:13:19',1,4),(177,'177.157.178.149','2013-05-08 19:19:49',1,2),(178,'189.13.78.217','2013-05-08 19:20:32',1,4),(179,'201.78.16.230','2013-05-08 19:20:52',1,3),(182,'177.39.12.21','2013-05-08 19:23:06',1,5),(183,'179.236.169.81','2013-05-08 19:23:20',1,1),(185,'187.20.35.114','2013-05-08 19:23:35',1,1),(187,'177.182.201.200','2013-05-08 19:24:43',1,3),(190,'179.167.49.72','2013-05-08 19:26:48',1,4),(196,'186.244.78.5','2013-05-08 19:35:36',1,1),(197,'177.179.186.206','2013-05-08 19:37:22',1,3),(199,'189.59.145.156','2013-05-08 19:41:12',1,3),(202,'186.244.19.62','2013-05-08 19:44:16',1,5),(203,'187.79.186.138','2013-05-08 19:44:36',1,4),(205,'187.114.18.53','2013-05-08 19:47:39',1,3),(208,'200.209.69.254','2013-05-08 19:50:49',1,5),(214,'177.97.210.125','2013-05-08 19:56:45',1,3),(227,'189.12.46.145','2013-05-08 20:04:52',1,3),(228,'150.164.195.239','2013-05-08 20:05:56',1,1),(229,'186.249.6.137','2013-05-08 20:07:00',1,5),(230,'143.107.45.11','2013-05-08 20:11:48',1,5),(232,'200.150.41.21','2013-05-08 20:12:57',1,2),(235,'201.80.119.6','2013-05-08 20:17:30',1,1),(237,'189.107.0.28','2013-05-08 20:18:43',1,1),(241,'201.80.13.128','2013-05-08 20:30:12',1,4),(242,'189.83.247.161','2013-05-08 20:33:28',1,5),(243,'186.206.135.87','2013-05-08 20:35:13',1,1),(244,'177.182.13.25','2013-05-08 20:39:24',1,4),(245,'201.19.1.244','2013-05-08 20:46:15',1,4),(246,'177.182.192.119','2013-05-08 20:47:09',1,4),(247,'150.164.216.193','2013-05-08 20:52:05',1,2),(248,'189.95.149.230','2013-05-08 20:54:26',1,4),(250,'189.59.144.148','2013-05-08 21:05:54',1,3),(251,'186.244.19.231','2013-05-08 21:10:40',1,3),(252,'189.83.179.181','2013-05-08 21:28:10',1,4),(253,'186.243.247.22','2013-05-08 21:35:07',1,4),(254,'177.152.171.94','2013-05-08 21:37:13',1,2),(255,'201.17.190.206','2013-05-08 21:42:17',1,2),(256,'189.83.179.97','2013-05-08 21:45:51',1,2),(257,'177.205.138.201','2013-05-08 21:55:51',1,3),(258,'187.20.37.15','2013-05-08 21:57:09',1,3),(259,'189.59.198.5','2013-05-08 22:02:06',1,3),(260,'189.61.184.18','2013-05-08 22:06:04',1,3),(261,'201.80.160.253','2013-05-08 22:10:28',1,1),(262,'201.80.207.206','2013-05-08 22:19:29',1,5),(264,'189.26.199.182','2013-05-08 22:20:34',1,5),(265,'187.114.49.10','2013-05-08 22:22:36',1,4),(274,'189.13.193.80','2013-05-08 22:39:18',1,5),(276,'189.83.162.254','2013-05-08 22:42:59',1,5),(280,'177.182.213.118','2013-05-08 22:44:43',1,5),(283,'177.182.118.71','2013-05-08 22:46:29',1,1),(286,'177.177.234.109','2013-05-08 22:47:46',1,4),(291,'187.78.191.129','2013-05-08 22:50:03',1,4),(294,'187.20.40.208','2013-05-08 22:51:00',1,3),(298,'189.13.97.217','2013-05-08 22:56:23',1,4),(299,'201.78.110.45','2013-05-08 22:56:55',1,1),(300,'179.236.5.92','2013-05-08 23:06:19',1,3),(301,'189.6.9.16','2013-05-08 23:09:13',1,4),(302,'179.214.211.234','2013-05-08 23:10:50',1,1),(303,'193.137.92.28','2013-05-08 23:11:51',1,1),(304,'189.92.6.206','2013-05-08 23:18:08',1,4),(305,'177.182.251.32','2013-05-08 23:22:04',1,5),(306,'189.107.16.185','2013-05-08 23:35:14',1,5),(307,'200.97.218.96','2013-05-08 23:46:11',1,3),(309,'189.83.49.167','2013-05-09 00:16:04',1,1),(311,'187.127.92.167','2013-05-09 00:22:08',1,3);

--
-- Table structure for table `relacao`
--

CREATE TABLE `relacao` (
  `cod_user` int(11) NOT NULL,
  `cod_enquete` int(11) NOT NULL,
  PRIMARY KEY (`cod_user`,`cod_enquete`),
  UNIQUE KEY `cod_enquete` (`cod_enquete`),
  KEY `cod_user` (`cod_user`),
  CONSTRAINT `relacao_ibfk_1` FOREIGN KEY (`cod_user`) REFERENCES `enquetes` (`cod_enquete`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `relacao_ibfk_2` FOREIGN KEY (`cod_enquete`) REFERENCES `enquetes` (`cod_enquete`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `relacao`
--

INSERT INTO `relacao` VALUES (1,1);

--
-- Table structure for table `resp_`
--

CREATE TABLE `resp_` (
  `cod_opcao` int(11) NOT NULL AUTO_INCREMENT,
  `Opcao` varchar(255) NOT NULL COMMENT 'Opção da enquete',
  `Votos` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT 'Número de votos da opção',
  `cod_enquete` int(11) NOT NULL,
  PRIMARY KEY (`cod_opcao`),
  KEY `cod_enquete_resp_` (`cod_enquete`),
  CONSTRAINT `resp__ibfk_1` FOREIGN KEY (`cod_enquete`) REFERENCES `enquetes` (`cod_enquete`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `resp_`
--

INSERT INTO `resp_` VALUES (1,'Aurora',0000000352,1),(2,'Benvinda',0000000211,1),(3,'Brisa',0000004112,1),(4,'Graciosa',0000006546,1),(5,'Serena',0000000819,1);

--
-- Table structure for table `resp_2`
--

CREATE TABLE `resp_2` (
  `cod_opcao` int(11) NOT NULL AUTO_INCREMENT,
  `Opcao` varchar(255) NOT NULL COMMENT 'Opção da enquete',
  `Votos` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT 'Número de votos da opção',
  `cod_enquete` int(11) NOT NULL,
  PRIMARY KEY (`cod_opcao`),
  KEY `cod_enquete_resp_` (`cod_enquete`),
  CONSTRAINT `resp_2_ibfk_1` FOREIGN KEY (`cod_enquete`) REFERENCES `enquetes_2` (`cod_enquete`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `resp_2`
--

INSERT INTO `resp_2` VALUES (1,'Aurora',0000000315,1),(2,'Benvinda',0000000186,1),(3,'Brisa',0000004036,1),(4,'Graciosa',0000006092,1),(5,'Serena',0000000772,1);


