Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.78 KB | None | 0 0
  1. -- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64)
  2. --
  3. -- Host: localhost Database: mydb
  4. -- ------------------------------------------------------
  5. -- Server version 8.0.17
  6.  
  7. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  8. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  9. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  10. /*!50503 SET NAMES utf8 */;
  11. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  12. /*!40103 SET TIME_ZONE='+00:00' */;
  13. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  14. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  15. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  16. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  17.  
  18. --
  19. -- Table structure for table `endereco`
  20. --
  21.  
  22. DROP TABLE IF EXISTS `endereco`;
  23. /*!40101 SET @saved_cs_client = @@character_set_client */;
  24. /*!50503 SET character_set_client = utf8mb4 */;
  25. CREATE TABLE `endereco` (
  26. `rua` varchar(30) NOT NULL,
  27. `numero` varchar(6) DEFAULT NULL,
  28. `complemento` varchar(10) DEFAULT NULL,
  29. `cep` varchar(9) NOT NULL,
  30. `bairro` varchar(45) NOT NULL,
  31. `motorista_id` int(11) unsigned zerofill NOT NULL,
  32. PRIMARY KEY (`motorista_id`),
  33. KEY `fk_Endereco_motorista_idx` (`motorista_id`)
  34. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  35. /*!40101 SET character_set_client = @saved_cs_client */;
  36.  
  37. --
  38. -- Dumping data for table `endereco`
  39. --
  40.  
  41. LOCK TABLES `endereco` WRITE;
  42. /*!40000 ALTER TABLE `endereco` DISABLE KEYS */;
  43. INSERT INTO `endereco` VALUES ('Av pres. Kennedy','4512','apt 209','11224545','parede amarela',01441448448),('rua domingos ferreira','1254','predio 2','15454474','caixa d\'agua',01454545454),('rua penelope lucas vericio','4875','apt 402','78965321','caida pequena',01543542154),('rua pedro ferreira','3542','apt 105','45415424','bultrins',01754844788),('rua marcondes costa','4568','apt 902','16584875','Casa caiada',02147483640);
  44. /*!40000 ALTER TABLE `endereco` ENABLE KEYS */;
  45. UNLOCK TABLES;
  46.  
  47. --
  48. -- Table structure for table `fabricante_veiculos`
  49. --
  50.  
  51. DROP TABLE IF EXISTS `fabricante_veiculos`;
  52. /*!40101 SET @saved_cs_client = @@character_set_client */;
  53. /*!50503 SET character_set_client = utf8mb4 */;
  54. CREATE TABLE `fabricante_veiculos` (
  55. `id` int(11) NOT NULL AUTO_INCREMENT,
  56. `nome` varchar(45) DEFAULT NULL,
  57. PRIMARY KEY (`id`)
  58. ) ENGINE=InnoDB AUTO_INCREMENT=1348756549 DEFAULT CHARSET=utf8;
  59. /*!40101 SET character_set_client = @saved_cs_client */;
  60.  
  61. --
  62. -- Dumping data for table `fabricante_veiculos`
  63. --
  64.  
  65. LOCK TABLES `fabricante_veiculos` WRITE;
  66. /*!40000 ALTER TABLE `fabricante_veiculos` DISABLE KEYS */;
  67. INSERT INTO `fabricante_veiculos` VALUES (25477665,'Mitsubishy'),(154264418,'Audi'),(1348756548,'Ford');
  68. /*!40000 ALTER TABLE `fabricante_veiculos` ENABLE KEYS */;
  69. UNLOCK TABLES;
  70.  
  71. --
  72. -- Table structure for table `inspetor`
  73. --
  74.  
  75. DROP TABLE IF EXISTS `inspetor`;
  76. /*!40101 SET @saved_cs_client = @@character_set_client */;
  77. /*!50503 SET character_set_client = utf8mb4 */;
  78. CREATE TABLE `inspetor` (
  79. `id` int(11) NOT NULL,
  80. `cargo` varchar(45) DEFAULT NULL,
  81. `nome` varchar(55) DEFAULT NULL,
  82. PRIMARY KEY (`id`)
  83. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  84. /*!40101 SET character_set_client = @saved_cs_client */;
  85.  
  86. --
  87. -- Dumping data for table `inspetor`
  88. --
  89.  
  90. LOCK TABLES `inspetor` WRITE;
  91. /*!40000 ALTER TABLE `inspetor` DISABLE KEYS */;
  92. INSERT INTO `inspetor` VALUES (215457856,'gerente de inspeção','Tiago Brito Murilo'),(1154815621,'estagiario','Bruno Dantas Vasconcelos');
  93. /*!40000 ALTER TABLE `inspetor` ENABLE KEYS */;
  94. UNLOCK TABLES;
  95.  
  96. --
  97. -- Table structure for table `jornada`
  98. --
  99.  
  100. DROP TABLE IF EXISTS `jornada`;
  101. /*!40101 SET @saved_cs_client = @@character_set_client */;
  102. /*!50503 SET character_set_client = utf8mb4 */;
  103. CREATE TABLE `jornada` (
  104. `id` int(11) NOT NULL AUTO_INCREMENT,
  105. `valor` decimal(13,2) NOT NULL,
  106. `inicio` datetime NOT NULL,
  107. `fim` datetime DEFAULT NULL,
  108. `distancia` int(4) DEFAULT NULL,
  109. `motorista_id` int(11) NOT NULL,
  110. `veiculo_placa` varchar(15) NOT NULL,
  111. PRIMARY KEY (`id`),
  112. KEY `fk_jornada_motorista1_idx` (`motorista_id`),
  113. KEY `fk_jornada_veiculo1_idx` (`veiculo_placa`),
  114. CONSTRAINT `fk_jornada_motorista1` FOREIGN KEY (`motorista_id`) REFERENCES `motorista` (`id`),
  115. CONSTRAINT `fk_jornada_veiculo1` FOREIGN KEY (`veiculo_placa`) REFERENCES `veiculo` (`placa`)
  116. ) ENGINE=InnoDB AUTO_INCREMENT=1231526429 DEFAULT CHARSET=utf8;
  117. /*!40101 SET character_set_client = @saved_cs_client */;
  118.  
  119. --
  120. -- Dumping data for table `jornada`
  121. --
  122.  
  123. LOCK TABLES `jornada` WRITE;
  124. /*!40000 ALTER TABLE `jornada` DISABLE KEYS */;
  125. INSERT INTO `jornada` VALUES (444841222,10.33,'2018-04-10 12:32:33','2018-04-10 12:44:12',5,1441448448,'PPK-6666'),(501514242,9.88,'2018-04-10 12:32:33','2018-04-10 12:44:12',6,1754844788,'TWK-4123'),(541515442,20.23,'2018-04-10 12:32:33','2018-04-10 12:44:12',1,1754844788,'TWK-4123'),(541548667,15.45,'2018-04-10 12:32:33','2018-04-10 12:44:12',3,2147483640,'UGH-1124'),(548158514,33.88,'2018-04-10 12:32:33','2018-04-10 12:44:12',25,2147483640,'UGH-1124'),(1231526428,21.20,'2018-04-10 12:32:33','2018-04-10 12:44:12',10,1441448448,'SUS-9988');
  126. /*!40000 ALTER TABLE `jornada` ENABLE KEYS */;
  127. UNLOCK TABLES;
  128.  
  129. --
  130. -- Table structure for table `modelos`
  131. --
  132.  
  133. DROP TABLE IF EXISTS `modelos`;
  134. /*!40101 SET @saved_cs_client = @@character_set_client */;
  135. /*!50503 SET character_set_client = utf8mb4 */;
  136. CREATE TABLE `modelos` (
  137. `id` int(11) NOT NULL AUTO_INCREMENT,
  138. `modelo` varchar(45) NOT NULL,
  139. `ano` varchar(45) NOT NULL,
  140. `cor` varchar(45) NOT NULL,
  141. `fabricante_veiculos_id` int(11) NOT NULL,
  142. PRIMARY KEY (`id`),
  143. KEY `fk_modelos_veiculos_fabricante_veiculos1_idx` (`fabricante_veiculos_id`),
  144. CONSTRAINT `fk_modelos_veiculos_fabricante_veiculos1` FOREIGN KEY (`fabricante_veiculos_id`) REFERENCES `fabricante_veiculos` (`id`)
  145. ) ENGINE=InnoDB AUTO_INCREMENT=1025456813 DEFAULT CHARSET=utf8;
  146. /*!40101 SET character_set_client = @saved_cs_client */;
  147.  
  148. --
  149. -- Dumping data for table `modelos`
  150. --
  151.  
  152. LOCK TABLES `modelos` WRITE;
  153. /*!40000 ALTER TABLE `modelos` DISABLE KEYS */;
  154. INSERT INTO `modelos` VALUES (21545154,'focus','2045','transparente',1348756548),(22545631,'layback','2026','preto',25477665),(24542416,'renegade','2018','grafite',1348756548),(215423658,'hetch','1398','arco-iris',25477665),(1002554534,'plug','2010','roxo',154264418),(1025456812,'inovation','2013','branco',154264418);
  155. /*!40000 ALTER TABLE `modelos` ENABLE KEYS */;
  156. UNLOCK TABLES;
  157.  
  158. --
  159. -- Table structure for table `motorista`
  160. --
  161.  
  162. DROP TABLE IF EXISTS `motorista`;
  163. /*!40101 SET @saved_cs_client = @@character_set_client */;
  164. /*!50503 SET character_set_client = utf8mb4 */;
  165. CREATE TABLE `motorista` (
  166. `id` int(11) NOT NULL,
  167. `nome` varchar(55) NOT NULL,
  168. `cnh` varchar(11) NOT NULL,
  169. PRIMARY KEY (`id`)
  170. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  171. /*!40101 SET character_set_client = @saved_cs_client */;
  172.  
  173. --
  174. -- Dumping data for table `motorista`
  175. --
  176.  
  177. LOCK TABLES `motorista` WRITE;
  178. /*!40000 ALTER TABLE `motorista` DISABLE KEYS */;
  179. INSERT INTO `motorista` VALUES (1441448448,'Luis Pedro Franco ','1122554654'),(1454545454,'Maria Regina Fonseca','1655545448'),(1543542154,'Luisa gomes Paola','2115456341'),(1754844788,'Marcos Abrantes Amorim','2015454455'),(2147483640,'Haroldo Funseca Marcos','1121215426');
  180. /*!40000 ALTER TABLE `motorista` ENABLE KEYS */;
  181. UNLOCK TABLES;
  182.  
  183. --
  184. -- Table structure for table `passageiro`
  185. --
  186.  
  187. DROP TABLE IF EXISTS `passageiro`;
  188. /*!40101 SET @saved_cs_client = @@character_set_client */;
  189. /*!50503 SET character_set_client = utf8mb4 */;
  190. CREATE TABLE `passageiro` (
  191. `cpf` varchar(11) NOT NULL,
  192. `nome` varchar(55) NOT NULL,
  193. `idade` int(3) NOT NULL,
  194. PRIMARY KEY (`cpf`)
  195. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  196. /*!40101 SET character_set_client = @saved_cs_client */;
  197.  
  198. --
  199. -- Dumping data for table `passageiro`
  200. --
  201.  
  202. LOCK TABLES `passageiro` WRITE;
  203. /*!40000 ALTER TABLE `passageiro` DISABLE KEYS */;
  204. INSERT INTO `passageiro` VALUES ('44587541425','Maria dos Santos Luz',26),('45157875426','Luisa Dantas Ferreira',45),('45785496584','Luis Fernando Carlos',47),('54845656214','Pedro Marcos Santos',25);
  205. /*!40000 ALTER TABLE `passageiro` ENABLE KEYS */;
  206. UNLOCK TABLES;
  207.  
  208. --
  209. -- Table structure for table `pessoa_fisica`
  210. --
  211.  
  212. DROP TABLE IF EXISTS `pessoa_fisica`;
  213. /*!40101 SET @saved_cs_client = @@character_set_client */;
  214. /*!50503 SET character_set_client = utf8mb4 */;
  215. CREATE TABLE `pessoa_fisica` (
  216. `cpf` varchar(11) NOT NULL,
  217. `motorista_id` int(11) NOT NULL,
  218. PRIMARY KEY (`cpf`,`motorista_id`),
  219. KEY `fk_pessoa_fisica_motorista1_idx` (`motorista_id`),
  220. CONSTRAINT `fk_pessoa_fisica_motorista1` FOREIGN KEY (`motorista_id`) REFERENCES `motorista` (`id`)
  221. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  222. /*!40101 SET character_set_client = @saved_cs_client */;
  223.  
  224. --
  225. -- Dumping data for table `pessoa_fisica`
  226. --
  227.  
  228. LOCK TABLES `pessoa_fisica` WRITE;
  229. /*!40000 ALTER TABLE `pessoa_fisica` DISABLE KEYS */;
  230. INSERT INTO `pessoa_fisica` VALUES ('12514568454',1543542154),('15451515424',1543542154),('15452155478',1754844788),('44545454554',2147483640);
  231. /*!40000 ALTER TABLE `pessoa_fisica` ENABLE KEYS */;
  232. UNLOCK TABLES;
  233.  
  234. --
  235. -- Table structure for table `pessoa_juridica`
  236. --
  237.  
  238. DROP TABLE IF EXISTS `pessoa_juridica`;
  239. /*!40101 SET @saved_cs_client = @@character_set_client */;
  240. /*!50503 SET character_set_client = utf8mb4 */;
  241. CREATE TABLE `pessoa_juridica` (
  242. `cnpj` varchar(18) NOT NULL,
  243. `motorista_id` int(11) NOT NULL,
  244. PRIMARY KEY (`cnpj`,`motorista_id`),
  245. KEY `fk_pessoa_juridica_motorista1_idx` (`motorista_id`),
  246. CONSTRAINT `fk_pessoa_juridica_motorista1` FOREIGN KEY (`motorista_id`) REFERENCES `motorista` (`id`)
  247. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  248. /*!40101 SET character_set_client = @saved_cs_client */;
  249.  
  250. --
  251. -- Dumping data for table `pessoa_juridica`
  252. --
  253.  
  254. LOCK TABLES `pessoa_juridica` WRITE;
  255. /*!40000 ALTER TABLE `pessoa_juridica` DISABLE KEYS */;
  256. INSERT INTO `pessoa_juridica` VALUES ('458457698458745698',2147483640);
  257. /*!40000 ALTER TABLE `pessoa_juridica` ENABLE KEYS */;
  258. UNLOCK TABLES;
  259.  
  260. --
  261. -- Table structure for table `reservas`
  262. --
  263.  
  264. DROP TABLE IF EXISTS `reservas`;
  265. /*!40101 SET @saved_cs_client = @@character_set_client */;
  266. /*!50503 SET character_set_client = utf8mb4 */;
  267. CREATE TABLE `reservas` (
  268. `id` int(11) NOT NULL AUTO_INCREMENT,
  269. `veiculo_placa` varchar(15) NOT NULL,
  270. `inicio` datetime DEFAULT NULL,
  271. `fim` datetime DEFAULT NULL,
  272. `passageiro_cpf` varchar(11) NOT NULL,
  273. PRIMARY KEY (`id`),
  274. KEY `fk_veiculo_has_passageiro_veiculo1_idx` (`veiculo_placa`),
  275. KEY `fk_reservas_passageiro1_idx` (`passageiro_cpf`),
  276. CONSTRAINT `fk_reservas_passageiro1` FOREIGN KEY (`passageiro_cpf`) REFERENCES `passageiro` (`cpf`),
  277. CONSTRAINT `fk_veiculo_has_passageiro_veiculo1` FOREIGN KEY (`veiculo_placa`) REFERENCES `veiculo` (`placa`)
  278. ) ENGINE=InnoDB AUTO_INCREMENT=1235412069 DEFAULT CHARSET=utf8;
  279. /*!40101 SET character_set_client = @saved_cs_client */;
  280.  
  281. --
  282. -- Dumping data for table `reservas`
  283. --
  284.  
  285. LOCK TABLES `reservas` WRITE;
  286. /*!40000 ALTER TABLE `reservas` DISABLE KEYS */;
  287. INSERT INTO `reservas` VALUES (21514543,'PEU-5142','2019-08-20 00:58:31','2019-08-20 01:20:03','44587541425'),(154187412,'UGH-1124','2019-08-22 00:58:31','2019-08-22 01:20:03','45785496584'),(241051154,'TIR-4587','2019-08-22 00:58:31','2019-08-22 01:20:03','54845656214'),(241541215,'SUS-9988','2019-08-22 00:58:31','2019-08-22 01:20:03','54845656214'),(245154724,'PPK-6666','2019-08-22 00:58:31','2019-08-22 01:20:03','45785496584'),(544542164,'PEU-5142','2019-08-22 00:58:31','2019-08-22 01:20:03','45157875426'),(544848441,'TWK-4123','2019-08-22 00:58:31','2019-08-22 01:20:03','54845656214'),(551154123,'UGH-1124','2019-08-22 00:58:31','2019-08-22 01:20:03','45157875426'),(1235412068,'LOL-4478','2019-08-22 00:58:31','2019-08-22 01:20:03','44587541425');
  288. /*!40000 ALTER TABLE `reservas` ENABLE KEYS */;
  289. UNLOCK TABLES;
  290.  
  291. --
  292. -- Table structure for table `veiculo`
  293. --
  294.  
  295. DROP TABLE IF EXISTS `veiculo`;
  296. /*!40101 SET @saved_cs_client = @@character_set_client */;
  297. /*!50503 SET character_set_client = utf8mb4 */;
  298. CREATE TABLE `veiculo` (
  299. `placa` varchar(15) NOT NULL,
  300. `chassi` varchar(45) NOT NULL,
  301. `data_inspecao` datetime DEFAULT NULL,
  302. `modelos_id` int(11) NOT NULL,
  303. `inspetor_id` int(11) NOT NULL,
  304. PRIMARY KEY (`placa`),
  305. KEY `fk_veiculo_modelos1_idx` (`modelos_id`),
  306. KEY `fk_veiculo_inspetor1_idx` (`inspetor_id`),
  307. CONSTRAINT `fk_veiculo_inspetor1` FOREIGN KEY (`inspetor_id`) REFERENCES `inspetor` (`id`),
  308. CONSTRAINT `fk_veiculo_modelos1` FOREIGN KEY (`modelos_id`) REFERENCES `modelos` (`id`)
  309. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  310. /*!40101 SET character_set_client = @saved_cs_client */;
  311.  
  312. --
  313. -- Dumping data for table `veiculo`
  314. --
  315.  
  316. LOCK TABLES `veiculo` WRITE;
  317. /*!40000 ALTER TABLE `veiculo` DISABLE KEYS */;
  318. INSERT INTO `veiculo` VALUES ('LOL-4478','POP1235VV','2010-05-12 01:24:35',1025456812,1154815621),('PEU-5142','EG45676DE','2010-05-12 01:24:35',21545154,215457856),('PPK-6666','LLU1244CC','2010-05-12 01:24:35',1002554534,215457856),('SUS-9988','FHE2333GH','2010-05-12 01:24:35',22545631,215457856),('TIR-4587','EFH3434DF','2010-05-12 01:24:35',22545631,215457856),('TWK-4123','LUE3232JK','2010-05-12 01:24:35',24542416,215457856),('UGH-1124','LEU2928FL','2010-05-12 01:24:35',215423658,215457856);
  319. /*!40000 ALTER TABLE `veiculo` ENABLE KEYS */;
  320. UNLOCK TABLES;
  321. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  322.  
  323. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  324. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  325. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  326. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  327. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  328. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  329. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  330.  
  331. -- Dump completed on 2019-08-20 14:26:15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement