· 6 years ago · Oct 31, 2019, 02:32 PM
1-- MySQL dump 10.13 Distrib 5.7.28, for Linux (x86_64)
2--
3-- Host: localhost Database: schokoshop
4-- ------------------------------------------------------
5-- Server version 5.7.28
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/*!40101 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 `availability`
20--
21
22DROP TABLE IF EXISTS `availability`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `availability` (
26 `description` varchar(120) NOT NULL,
27 PRIMARY KEY (`description`)
28) ENGINE=InnoDB DEFAULT CHARSET=latin1;
29/*!40101 SET character_set_client = @saved_cs_client */;
30
31--
32-- Dumping data for table `availability`
33--
34
35LOCK TABLES `availability` WRITE;
36/*!40000 ALTER TABLE `availability` DISABLE KEYS */;
37/*!40000 ALTER TABLE `availability` ENABLE KEYS */;
38UNLOCK TABLES;
39
40--
41-- Table structure for table `brand`
42--
43
44DROP TABLE IF EXISTS `brand`;
45/*!40101 SET @saved_cs_client = @@character_set_client */;
46/*!40101 SET character_set_client = utf8 */;
47CREATE TABLE `brand` (
48 `name` varchar(120) NOT NULL,
49 PRIMARY KEY (`name`)
50) ENGINE=InnoDB DEFAULT CHARSET=latin1;
51/*!40101 SET character_set_client = @saved_cs_client */;
52
53--
54-- Dumping data for table `brand`
55--
56
57LOCK TABLES `brand` WRITE;
58/*!40000 ALTER TABLE `brand` DISABLE KEYS */;
59/*!40000 ALTER TABLE `brand` ENABLE KEYS */;
60UNLOCK TABLES;
61
62--
63-- Table structure for table `category`
64--
65
66DROP TABLE IF EXISTS `category`;
67/*!40101 SET @saved_cs_client = @@character_set_client */;
68/*!40101 SET character_set_client = utf8 */;
69CREATE TABLE `category` (
70 `description` varchar(120) NOT NULL,
71 PRIMARY KEY (`description`)
72) ENGINE=InnoDB DEFAULT CHARSET=latin1;
73/*!40101 SET character_set_client = @saved_cs_client */;
74
75--
76-- Dumping data for table `category`
77--
78
79LOCK TABLES `category` WRITE;
80/*!40000 ALTER TABLE `category` DISABLE KEYS */;
81/*!40000 ALTER TABLE `category` ENABLE KEYS */;
82UNLOCK TABLES;
83
84--
85-- Table structure for table `product`
86--
87
88DROP TABLE IF EXISTS `product`;
89/*!40101 SET @saved_cs_client = @@character_set_client */;
90/*!40101 SET character_set_client = utf8 */;
91CREATE TABLE `product` (
92 `sku` int(11) NOT NULL,
93 `name` varchar(120) NOT NULL,
94 `description` text NOT NULL,
95 `vegan` tinyint(1) NOT NULL,
96 `energy` double NOT NULL COMMENT 'for 100 grams [g]',
97 `carbohydrates` double NOT NULL COMMENT 'grams [g]',
98 `sugars` double NOT NULL COMMENT 'grams [g]',
99 `fats` double NOT NULL COMMENT 'grams [g]',
100 `saturated_fats` double NOT NULL COMMENT 'grams [g]',
101 `proteins` double NOT NULL COMMENT 'grams [g]',
102 `salt` double NOT NULL COMMENT 'grams [g]',
103 `price` double NOT NULL COMMENT 'Swiss Francs [CHF]',
104 `fk_availability` varchar(120) NOT NULL,
105 `fk_shape` varchar(120) NOT NULL,
106 `fk_category` varchar(120) NOT NULL,
107 `fk_brand` varchar(120) NOT NULL,
108 PRIMARY KEY (`sku`),
109 KEY `fk_availability` (`fk_availability`),
110 KEY `fk_brand` (`fk_brand`),
111 KEY `fk_category` (`fk_category`),
112 KEY `fk_shape` (`fk_shape`),
113 CONSTRAINT `product_ibfk_1` FOREIGN KEY (`fk_availability`) REFERENCES `availability` (`description`),
114 CONSTRAINT `product_ibfk_2` FOREIGN KEY (`fk_brand`) REFERENCES `brand` (`name`),
115 CONSTRAINT `product_ibfk_3` FOREIGN KEY (`fk_category`) REFERENCES `category` (`description`),
116 CONSTRAINT `product_ibfk_4` FOREIGN KEY (`fk_shape`) REFERENCES `shape` (`description`)
117) ENGINE=InnoDB DEFAULT CHARSET=latin1;
118/*!40101 SET character_set_client = @saved_cs_client */;
119
120--
121-- Dumping data for table `product`
122--
123
124LOCK TABLES `product` WRITE;
125/*!40000 ALTER TABLE `product` DISABLE KEYS */;
126/*!40000 ALTER TABLE `product` ENABLE KEYS */;
127UNLOCK TABLES;
128
129--
130-- Table structure for table `shape`
131--
132
133DROP TABLE IF EXISTS `shape`;
134/*!40101 SET @saved_cs_client = @@character_set_client */;
135/*!40101 SET character_set_client = utf8 */;
136CREATE TABLE `shape` (
137 `description` varchar(120) NOT NULL,
138 PRIMARY KEY (`description`)
139) ENGINE=InnoDB DEFAULT CHARSET=latin1;
140/*!40101 SET character_set_client = @saved_cs_client */;
141
142--
143-- Dumping data for table `shape`
144--
145
146LOCK TABLES `shape` WRITE;
147/*!40000 ALTER TABLE `shape` DISABLE KEYS */;
148/*!40000 ALTER TABLE `shape` ENABLE KEYS */;
149UNLOCK TABLES;
150/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
151
152/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
153/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
154/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
155/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
156/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
157/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
158/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
159
160-- Dump completed on 2019-10-31 12:41:00