· 4 years ago · Jan 13, 2021, 10:28 AM
1-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
2--
3-- Host: localhost Database: db_supermercado
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 `categoria`
20--
21
22DROP TABLE IF EXISTS `categoria`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!50503 SET character_set_client = utf8mb4 */;
25CREATE TABLE `categoria` (
26 `id` int NOT NULL AUTO_INCREMENT,
27 `nomcategoria` varchar(45) NOT NULL,
28 PRIMARY KEY (`id`)
29) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
30/*!40101 SET character_set_client = @saved_cs_client */;
31
32--
33-- Dumping data for table `categoria`
34--
35
36LOCK TABLES `categoria` WRITE;
37/*!40000 ALTER TABLE `categoria` DISABLE KEYS */;
38INSERT INTO `categoria` VALUES (1,'vino'),(2,'lacteo'),(3,'fruta'),(4,'verdura');
39/*!40000 ALTER TABLE `categoria` ENABLE KEYS */;
40UNLOCK TABLES;
41
42--
43-- Table structure for table `procedencia`
44--
45
46DROP TABLE IF EXISTS `procedencia`;
47/*!40101 SET @saved_cs_client = @@character_set_client */;
48/*!50503 SET character_set_client = utf8mb4 */;
49CREATE TABLE `procedencia` (
50 `id` int NOT NULL AUTO_INCREMENT,
51 `nomprocedencia` varchar(100) NOT NULL,
52 PRIMARY KEY (`id`)
53) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
54/*!40101 SET character_set_client = @saved_cs_client */;
55
56--
57-- Dumping data for table `procedencia`
58--
59
60LOCK TABLES `procedencia` WRITE;
61/*!40000 ALTER TABLE `procedencia` DISABLE KEYS */;
62INSERT INTO `procedencia` VALUES (1,'Gernika'),(2,'Padron'),(3,'Roncal'),(4,'Idiazabal'),(5,'La Rioja'),(6,'Ribera Duero'),(7,'Getaria');
63/*!40000 ALTER TABLE `procedencia` ENABLE KEYS */;
64UNLOCK TABLES;
65
66--
67-- Table structure for table `producto`
68--
69
70DROP TABLE IF EXISTS `producto`;
71/*!40101 SET @saved_cs_client = @@character_set_client */;
72/*!50503 SET character_set_client = utf8mb4 */;
73CREATE TABLE `producto` (
74 `id` int NOT NULL AUTO_INCREMENT,
75 `nombre` varchar(45) NOT NULL,
76 `descripcion` varchar(200) NOT NULL,
77 `precio` float NOT NULL,
78 `descuento` int NOT NULL,
79 `stock` int NOT NULL,
80 `FK_categoria` int NOT NULL,
81 `FK_procedencia` int NOT NULL,
82 PRIMARY KEY (`id`),
83 KEY `FK_categoria_idx` (`FK_categoria`),
84 KEY `FK_procedencia_idx` (`FK_procedencia`),
85 CONSTRAINT `FK_categoria` FOREIGN KEY (`FK_categoria`) REFERENCES `categoria` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
86 CONSTRAINT `FK_procedencia` FOREIGN KEY (`FK_procedencia`) REFERENCES `procedencia` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
87) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
88/*!40101 SET character_set_client = @saved_cs_client */;
89
90--
91-- Dumping data for table `producto`
92--
93
94LOCK TABLES `producto` WRITE;
95/*!40000 ALTER TABLE `producto` DISABLE KEYS */;
96INSERT INTO `producto` VALUES (1,'Txomin Etxaniz','Txakoli de Getaria',10,5,20,1,7),(2,'Pimiento verde','Pimientos para freir',20,10,100,4,1),(3,'Alegria','Pimientos rojos picantes',15,8,80,4,5),(4,'Matarromera','Vino tinto',12,5,70,1,6),(5,'Queso Larra','Queso de Roncal',15,6,40,2,3);
97/*!40000 ALTER TABLE `producto` ENABLE KEYS */;
98UNLOCK TABLES;
99/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
100
101/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
102/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
103/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
104/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
105/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
106/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
107/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
108
109-- Dump completed on 2021-01-13 11:15:25
110