· 5 years ago · Nov 24, 2020, 10:46 AM
1-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
2--
3-- Host: 127.0.0.1 Database: db_turismo
4-- ------------------------------------------------------
5-- Server version 8.0.22
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 `hoteles`
20--
21
22DROP TABLE IF EXISTS `hoteles`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!50503 SET character_set_client = utf8mb4 */;
25CREATE TABLE `hoteles` (
26 `id` int NOT NULL AUTO_INCREMENT,
27 `hotel` varchar(45) NOT NULL,
28 `numestrellas` int NOT NULL,
29 `FK_pais` int NOT NULL,
30 PRIMARY KEY (`id`),
31 KEY `hoteles_ibfk_1` (`FK_pais`),
32 CONSTRAINT `hoteles_ibfk_1` FOREIGN KEY (`FK_pais`) REFERENCES `paises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
33) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36--
37-- Dumping data for table `hoteles`
38--
39
40LOCK TABLES `hoteles` WRITE;
41/*!40000 ALTER TABLE `hoteles` DISABLE KEYS */;
42INSERT INTO `hoteles` VALUES (1,'hotel ercilla',5,1),(2,'hotel HH',3,4),(3,'hotel vie',4,5),(4,'hotel relax',4,3),(5,'hotel luxe',3,6),(6,'hotel rue',2,2),(7,'hotel vicente',3,1),(8,'hotel haty',4,5);
43/*!40000 ALTER TABLE `hoteles` ENABLE KEYS */;
44UNLOCK TABLES;
45
46--
47-- Table structure for table `lugares`
48--
49
50DROP TABLE IF EXISTS `lugares`;
51/*!40101 SET @saved_cs_client = @@character_set_client */;
52/*!50503 SET character_set_client = utf8mb4 */;
53CREATE TABLE `lugares` (
54 `id` int NOT NULL AUTO_INCREMENT,
55 `nombre` varchar(45) NOT NULL,
56 `descripcion` varchar(150) NOT NULL,
57 `FK_pais` int NOT NULL,
58 PRIMARY KEY (`id`),
59 KEY `lugares_ibfk_1` (`FK_pais`),
60 CONSTRAINT `lugares_ibfk_1` FOREIGN KEY (`FK_pais`) REFERENCES `paises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
61) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
62/*!40101 SET character_set_client = @saved_cs_client */;
63
64--
65-- Dumping data for table `lugares`
66--
67
68LOCK TABLES `lugares` WRITE;
69/*!40000 ALTER TABLE `lugares` DISABLE KEYS */;
70INSERT INTO `lugares` VALUES (1,'guggenheim','muy chuli',1),(2,'torre eiffel','mucho metal',3),(3,'torre de pisa','todo muy torcido',6),(4,'museo de cera','se puede quemar',2),(5,'arenal','precioso',1);
71/*!40000 ALTER TABLE `lugares` ENABLE KEYS */;
72UNLOCK TABLES;
73
74--
75-- Table structure for table `lugarestipos`
76--
77
78DROP TABLE IF EXISTS `lugarestipos`;
79/*!40101 SET @saved_cs_client = @@character_set_client */;
80/*!50503 SET character_set_client = utf8mb4 */;
81CREATE TABLE `lugarestipos` (
82 `id` int NOT NULL AUTO_INCREMENT,
83 `FK_lugar` int NOT NULL,
84 `FK_tipo` int NOT NULL,
85 PRIMARY KEY (`id`),
86 KEY `lugarestipos_ibfk_1` (`FK_lugar`),
87 KEY `lugarestipos_ibfk_2` (`FK_tipo`),
88 CONSTRAINT `lugarestipos_ibfk_1` FOREIGN KEY (`FK_lugar`) REFERENCES `lugares` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
89 CONSTRAINT `lugarestipos_ibfk_2` FOREIGN KEY (`FK_tipo`) REFERENCES `tipos` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
90) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
91/*!40101 SET character_set_client = @saved_cs_client */;
92
93--
94-- Dumping data for table `lugarestipos`
95--
96
97LOCK TABLES `lugarestipos` WRITE;
98/*!40000 ALTER TABLE `lugarestipos` DISABLE KEYS */;
99INSERT INTO `lugarestipos` VALUES (1,1,4),(2,2,5),(3,3,5),(4,4,4),(5,2,2),(6,3,2),(7,5,2);
100/*!40000 ALTER TABLE `lugarestipos` ENABLE KEYS */;
101UNLOCK TABLES;
102
103--
104-- Table structure for table `paises`
105--
106
107DROP TABLE IF EXISTS `paises`;
108/*!40101 SET @saved_cs_client = @@character_set_client */;
109/*!50503 SET character_set_client = utf8mb4 */;
110CREATE TABLE `paises` (
111 `id` int NOT NULL AUTO_INCREMENT,
112 `pais` varchar(45) NOT NULL,
113 PRIMARY KEY (`id`)
114) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
115/*!40101 SET character_set_client = @saved_cs_client */;
116
117--
118-- Dumping data for table `paises`
119--
120
121LOCK TABLES `paises` WRITE;
122/*!40000 ALTER TABLE `paises` DISABLE KEYS */;
123INSERT INTO `paises` VALUES (1,'España'),(2,'Alemania'),(3,'Francia'),(4,'Portugal'),(5,'Mexico'),(6,'Italia');
124/*!40000 ALTER TABLE `paises` ENABLE KEYS */;
125UNLOCK TABLES;
126
127--
128-- Table structure for table `tipos`
129--
130
131DROP TABLE IF EXISTS `tipos`;
132/*!40101 SET @saved_cs_client = @@character_set_client */;
133/*!50503 SET character_set_client = utf8mb4 */;
134CREATE TABLE `tipos` (
135 `id` int NOT NULL AUTO_INCREMENT,
136 `nombre` varchar(45) NOT NULL,
137 PRIMARY KEY (`id`)
138) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
139/*!40101 SET character_set_client = @saved_cs_client */;
140
141--
142-- Dumping data for table `tipos`
143--
144
145LOCK TABLES `tipos` WRITE;
146/*!40000 ALTER TABLE `tipos` DISABLE KEYS */;
147INSERT INTO `tipos` VALUES (1,'lago'),(2,'parque'),(3,'estatua'),(4,'museo'),(5,'monumento');
148/*!40000 ALTER TABLE `tipos` ENABLE KEYS */;
149UNLOCK TABLES;
150
151--
152-- Table structure for table `usuarios`
153--
154
155DROP TABLE IF EXISTS `usuarios`;
156/*!40101 SET @saved_cs_client = @@character_set_client */;
157/*!50503 SET character_set_client = utf8mb4 */;
158CREATE TABLE `usuarios` (
159 `id` int NOT NULL AUTO_INCREMENT,
160 `nombre` varchar(45) NOT NULL,
161 PRIMARY KEY (`id`)
162) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
163/*!40101 SET character_set_client = @saved_cs_client */;
164
165--
166-- Dumping data for table `usuarios`
167--
168
169LOCK TABLES `usuarios` WRITE;
170/*!40000 ALTER TABLE `usuarios` DISABLE KEYS */;
171INSERT INTO `usuarios` VALUES (1,'Helena'),(2,'Ana'),(3,'Ander'),(4,'Ion');
172/*!40000 ALTER TABLE `usuarios` ENABLE KEYS */;
173UNLOCK TABLES;
174
175--
176-- Table structure for table `usuarioshotel`
177--
178
179DROP TABLE IF EXISTS `usuarioshotel`;
180/*!40101 SET @saved_cs_client = @@character_set_client */;
181/*!50503 SET character_set_client = utf8mb4 */;
182CREATE TABLE `usuarioshotel` (
183 `id` int NOT NULL AUTO_INCREMENT,
184 `valoracion` int NOT NULL,
185 `FK_usuario` int NOT NULL,
186 `FK_hotel` int NOT NULL,
187 PRIMARY KEY (`id`),
188 KEY `FK_usuario` (`FK_usuario`),
189 KEY `FK_hotel` (`FK_hotel`),
190 CONSTRAINT `usuarioshotel_ibfk_1` FOREIGN KEY (`FK_usuario`) REFERENCES `usuarios` (`id`),
191 CONSTRAINT `usuarioshotel_ibfk_2` FOREIGN KEY (`FK_hotel`) REFERENCES `hoteles` (`id`),
192 CONSTRAINT `usuarioshotel_chk_1` CHECK ((`valoracion` between 0 and 11))
193) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
194/*!40101 SET character_set_client = @saved_cs_client */;
195
196--
197-- Dumping data for table `usuarioshotel`
198--
199
200LOCK TABLES `usuarioshotel` WRITE;
201/*!40000 ALTER TABLE `usuarioshotel` DISABLE KEYS */;
202INSERT INTO `usuarioshotel` VALUES (1,7,1,6),(2,9,1,2),(3,5,2,3),(4,10,2,1),(5,8,3,5),(6,7,3,4),(7,6,4,8),(8,7,4,5);
203/*!40000 ALTER TABLE `usuarioshotel` ENABLE KEYS */;
204UNLOCK TABLES;
205
206--
207-- Table structure for table `usuarioslugar`
208--
209
210DROP TABLE IF EXISTS `usuarioslugar`;
211/*!40101 SET @saved_cs_client = @@character_set_client */;
212/*!50503 SET character_set_client = utf8mb4 */;
213CREATE TABLE `usuarioslugar` (
214 `id` int NOT NULL AUTO_INCREMENT,
215 `valoracion` int NOT NULL,
216 `FK_usuario` int NOT NULL,
217 `FK_lugar` int NOT NULL,
218 PRIMARY KEY (`id`),
219 KEY `FK_usuario` (`FK_usuario`),
220 KEY `FK_lugar` (`FK_lugar`),
221 CONSTRAINT `usuarioslugar_ibfk_1` FOREIGN KEY (`FK_usuario`) REFERENCES `usuarios` (`id`),
222 CONSTRAINT `usuarioslugar_ibfk_2` FOREIGN KEY (`FK_lugar`) REFERENCES `lugares` (`id`),
223 CONSTRAINT `usuarioslugar_chk_1` CHECK ((`valoracion` between 0 and 11))
224) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
225/*!40101 SET character_set_client = @saved_cs_client */;
226
227--
228-- Dumping data for table `usuarioslugar`
229--
230
231LOCK TABLES `usuarioslugar` WRITE;
232/*!40000 ALTER TABLE `usuarioslugar` DISABLE KEYS */;
233INSERT INTO `usuarioslugar` VALUES (1,9,1,4),(2,4,1,3),(3,6,2,5),(4,8,2,2),(5,5,3,3),(6,7,3,1),(7,8,4,2),(8,9,4,1);
234/*!40000 ALTER TABLE `usuarioslugar` ENABLE KEYS */;
235UNLOCK TABLES;
236/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
237
238/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
239/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
240/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
241/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
242/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
243/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
244/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
245
246-- Dump completed on 2020-11-24 11:36:26
247