· 4 years ago · Dec 08, 2020, 04:16 PM
1-- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64)
2--
3-- Host: 0.0.0.0 Database: test_lucia
4-- ------------------------------------------------------
5-- Server version 5.6.50
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 utf8mb4 */;
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 `boxes_shipped`
20--
21
22DROP TABLE IF EXISTS `boxes_shipped`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!50503 SET character_set_client = utf8mb4 */;
25CREATE TABLE `boxes_shipped` (
26 `box_id` int(11) NOT NULL AUTO_INCREMENT,
27 `delivery_date` int(11) NOT NULL,
28 `fk_customer_id` int(11) NOT NULL,
29 `fk_product_id` int(11) NOT NULL,
30 `revenue_eur` float NOT NULL,
31 `country` varchar(100) NOT NULL,
32 `delivery_week` varchar(100) NOT NULL,
33 PRIMARY KEY (`box_id`),
34 KEY `boxes_shipped_FK` (`fk_customer_id`),
35 KEY `boxes_shipped_FK_1` (`fk_product_id`),
36 CONSTRAINT `boxes_shipped_FK` FOREIGN KEY (`fk_customer_id`) REFERENCES `customers` (`customer_id`),
37 CONSTRAINT `boxes_shipped_FK_1` FOREIGN KEY (`fk_product_id`) REFERENCES `products` (`product_id`)
38) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
39/*!40101 SET character_set_client = @saved_cs_client */;
40
41--
42-- Dumping data for table `boxes_shipped`
43--
44
45LOCK TABLES `boxes_shipped` WRITE;
46/*!40000 ALTER TABLE `boxes_shipped` DISABLE KEYS */;
47INSERT INTO `boxes_shipped` VALUES (1,20200110,1,1,60000,'BR','2020-W01'),(2,20200110,1,1,80000,'BR','2020-W01'),(3,20200110,2,1,12000,'BR','2020-W02'),(4,20200110,2,1,6000,'US','2020-W02'),(5,20200110,1,1,8000,'US','2020-W02'),(6,20200110,2,1,300000,'BR','2020-W01');
48/*!40000 ALTER TABLE `boxes_shipped` ENABLE KEYS */;
49UNLOCK TABLES;
50
51--
52-- Table structure for table `customers`
53--
54
55DROP TABLE IF EXISTS `customers`;
56/*!40101 SET @saved_cs_client = @@character_set_client */;
57/*!50503 SET character_set_client = utf8mb4 */;
58CREATE TABLE `customers` (
59 `customer_id` int(11) NOT NULL AUTO_INCREMENT,
60 `country` varchar(100) NOT NULL,
61 `customer_since` int(11) NOT NULL,
62 PRIMARY KEY (`customer_id`)
63) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
64/*!40101 SET character_set_client = @saved_cs_client */;
65
66--
67-- Dumping data for table `customers`
68--
69
70LOCK TABLES `customers` WRITE;
71/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
72INSERT INTO `customers` VALUES (1,'BR',202001),(2,'US',202001);
73/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
74UNLOCK TABLES;
75
76--
77-- Table structure for table `products`
78--
79
80DROP TABLE IF EXISTS `products`;
81/*!40101 SET @saved_cs_client = @@character_set_client */;
82/*!50503 SET character_set_client = utf8mb4 */;
83CREATE TABLE `products` (
84 `product_id` int(11) NOT NULL AUTO_INCREMENT,
85 `country` varchar(100) NOT NULL,
86 `product_name` varchar(100) NOT NULL,
87 `product_family` varchar(100) NOT NULL,
88 PRIMARY KEY (`product_id`)
89) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
90/*!40101 SET character_set_client = @saved_cs_client */;
91
92--
93-- Dumping data for table `products`
94--
95
96LOCK TABLES `products` WRITE;
97/*!40000 ALTER TABLE `products` DISABLE KEYS */;
98INSERT INTO `products` VALUES (1,'BR','Teste Brasil','Fones'),(2,'US','Teste US ','Fones');
99/*!40000 ALTER TABLE `products` ENABLE KEYS */;
100UNLOCK TABLES;
101/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
102
103/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
104/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
105/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
106/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
107/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
108/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
109/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
110
111-- Dump completed on 2020-12-08 12:03:09
112