Guest User

Untitled

a guest
Jul 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 4.03 KB | None | 0 0
  1. # MySQL-Front 5.0  (Build 1.0)
  2.  
  3. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
  4. /*!40101 SET SQL_MODE='' */;
  5. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
  6. /*!40103 SET SQL_NOTES='ON' */;
  7. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
  8. /*!40014 SET UNIQUE_CHECKS=0 */;
  9. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS */;
  10. /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
  11.  
  12.  
  13. # Host: localhost    DATABASE: sinfo
  14. # ------------------------------------------------------
  15. # Server version 5.1.36-community-log
  16.  
  17. DROP DATABASE IF EXISTS `sinfo`;
  18. CREATE DATABASE `sinfo` /*!40100 DEFAULT CHARACTER SET utf8 */;
  19. USE `sinfo`;
  20.  
  21. CREATE TABLE `comissao` (
  22.   `Id` INT(11) NOT NULL AUTO_INCREMENT,
  23.   `NumeroAluno` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  24.   `Curso` enum('leic','meic','deic','trabalha','outro') NOT NULL DEFAULT 'leic',
  25.   PRIMARY KEY (`Id`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  27. /*!40000 ALTER TABLE `comissao` ENABLE KEYS */;
  28. UNLOCK TABLES;
  29.  
  30.  
  31. #
  32. # TABLE STRUCTURE FOR TABLE empresas
  33. #
  34.  
  35. CREATE TABLE `empresas` (
  36.   `Id_Empresa` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  37.   `Nome` VARCHAR(255) NOT NULL DEFAULT '',
  38.   `Categoria` VARCHAR(255) DEFAULT NULL,
  39.   `Detalhes` text,
  40.   `Tipo` enum('outro','imprensa','spinoff','banco','consultoria','inteligencia artificial','multimedia','política e autarquica','redes','revista','telecomunicacoes','transportes','venda e distribuicao') NOT NULL DEFAULT 'outro',
  41.   `Morada` text,
  42.   `Telefone` INT(11) UNSIGNED DEFAULT NULL,
  43.   `E-mail` VARCHAR(255) DEFAULT NULL,
  44.   `Id_Forum` INT(11) UNSIGNED DEFAULT NULL,
  45.   `Id_Thread` INT(11) UNSIGNED DEFAULT NULL,
  46.   `Site` VARCHAR(300) DEFAULT NULL,
  47.   PRIMARY KEY (`Id_Empresa`)
  48. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  49. INSERT INTO `empresas` VALUES (3,'',NULL,NULL,'outro',NULL,NULL,NULL,NULL,NULL,NULL);
  50. /*!40000 ALTER TABLE `empresas` ENABLE KEYS */;
  51. UNLOCK TABLES;
  52.  
  53. #
  54. # TABLE STRUCTURE FOR TABLE empresas_contactos
  55. #
  56.  
  57. CREATE TABLE `empresas_contactos` (
  58.   `Id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  59.   `Id_Empresa` INT(11) UNSIGNED NOT NULL,
  60.   `Nome` VARCHAR(255) NOT NULL DEFAULT '',
  61.   `Detalhes` text,
  62.   `E-mail` VARCHAR(255) DEFAULT '',
  63.   `Telefone` INT(15) UNSIGNED DEFAULT NULL,
  64.   `Activo` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
  65.   `Cargo` VARCHAR(255) DEFAULT NULL COMMENT 'cargo dentro da empresa',
  66.   PRIMARY KEY (`Id`),
  67.   KEY `Id_Empresa` (`Id_Empresa`)
  68. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  69. /*!40000 ALTER TABLE `empresas_contactos` ENABLE KEYS */;
  70. UNLOCK TABLES;
  71.  
  72. #
  73. # TABLE STRUCTURE FOR TABLE empresas_participacoes
  74. #
  75.  
  76. CREATE TABLE `empresas_participacoes` (
  77.   `Id` INT(11) NOT NULL AUTO_INCREMENT,
  78.   `Id_Empresa` INT(11) UNSIGNED NOT NULL,
  79.   `Edicao` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  80.   `Detalhes` text COMMENT 'tipo de stand, temas, razao de rejeicao etc...',
  81.   `Participacao` enum('wps','wp','ps','ws','w','p','s','rejeitou') DEFAULT NULL COMMENT 'w - workshop, s - stand, p - presentation',
  82.   `Valor` FLOAT(10,3) UNSIGNED NOT NULL DEFAULT '0.000',
  83.   PRIMARY KEY (`Id`),
  84.   UNIQUE KEY `NewIndex` (`Edicao`,`Id_Empresa`),
  85.   KEY `Id_Empresa` (`Id_Empresa`)
  86. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  87. INSERT INTO `empresas_participacoes` VALUES (3,3,0,NULL,NULL,0);
  88. /*!40000 ALTER TABLE `empresas_participacoes` ENABLE KEYS */;
  89. UNLOCK TABLES;
  90.  
  91. #
  92. #  FOREIGN KEYS FOR TABLE empresas_contactos
  93. #
  94.  
  95. ALTER TABLE `empresas_contactos`
  96. ADD CONSTRAINT `empresas_contactos_ibfk_1` FOREIGN KEY (`Id_Empresa`) REFERENCES `empresas` (`Id_Empresa`) ON DELETE CASCADE,
  97.   ADD CONSTRAINT `empresas_contactos_ibfk_2` FOREIGN KEY (`Id_Empresa`) REFERENCES `empresas` (`Id_Empresa`) ON DELETE CASCADE;
  98.  
  99. #
  100. #  FOREIGN KEYS FOR TABLE empresas_participacoes
  101. #
  102.  
  103. ALTER TABLE `empresas_participacoes`
  104. ADD CONSTRAINT `empresas_participacoes_ibfk_1` FOREIGN KEY (`Id_Empresa`) REFERENCES `empresas` (`Id_Empresa`) ON DELETE CASCADE;
  105.  
  106.  
  107. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  108. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  109. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  110. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
Add Comment
Please, Sign In to add comment