/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE TABLE IF NOT EXISTS `participa` (
  `cpparticipa` int(11) unsigned NOT NULL,
  `cefuncionario` int(11) DEFAULT NULL,
  `ceprojeto` smallint(6) unsigned DEFAULT NULL,
  `dtinicio` date DEFAULT NULL,
  `dttermino` date DEFAULT NULL,
  `dtcadparticipa` date DEFAULT NULL,
  PRIMARY KEY (`cpparticipa`),
  KEY `Index 2` (`cefuncionario`),
  KEY `Index 3` (`ceprojeto`),
  CONSTRAINT `participace1` FOREIGN KEY (`cefuncionario`) REFERENCES `funcionarios` (`cpfuncionario`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `participace2` FOREIGN KEY (`ceprojeto`) REFERENCES `projetos` (`cpprojeto`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

/*!40000 ALTER TABLE `participa` DISABLE KEYS */;
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(1, 280, 1, '2021-04-20', '2021-04-25', '2021-05-07');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(2, 200, 2, '2021-04-23', NULL, '2021-04-30');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(3, 330, 1, '2021-04-26', '2021-04-30', '2021-05-07');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(4, 200, 3, '2021-04-28', NULL, '2021-05-07');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(5, 200, 1, '2021-04-05', '2021-04-22', '0000-00-00');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(6, 520, 1, '2021-04-05', '2021-04-22', '2021-04-26');
INSERT INTO `participa` (`cpparticipa`, `cefuncionario`, `ceprojeto`, `dtinicio`, `dttermino`, `dtcadparticipa`) VALUES
	(8, 70, 3, '2021-03-08', '2021-03-12', '2021-03-15');
/*!40000 ALTER TABLE `participa` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
