-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaveworld.sql
258 lines (220 loc) · 7.8 KB
/
saveworld.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-10-2019 a las 13:24:00
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `saveworld`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `containers`
--
CREATE TABLE `containers` (
`id_container` int(11) NOT NULL,
`numberContainer` int(11) NOT NULL,
`nameContainer` varchar(65) CHARACTER SET latin1 NOT NULL,
`acronymContainer` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`idMaterial` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `containers`
--
INSERT INTO `containers` (`id_container`, `numberContainer`, `nameContainer`, `acronymContainer`, `idMaterial`) VALUES
(1, 1, 'Tereftalato de Polietileno', 'PET', 1),
(2, 2, 'Polietileno de Alta Densidad', 'HDPE', 1),
(3, 3, 'Cloruro de Polivinilo', 'PVC', 1),
(4, 4, 'Polietileno de Baja Densidad', 'PELD', 1),
(5, 5, 'Polipropileno', 'PP', 1),
(6, 6, 'Poliestireno', 'PS', 1),
(7, 7, 'Otros', '(OTHER)', 1),
(8, 8, 'Pila de Plomo-Ãcido', 'Lead', 2),
(9, 9, 'Acrilonitrilo Butadieno Estireno', 'ABS', 1),
(10, 10, 'BaterÃa de NÃquel-Cadmio', 'NiCD', 2),
(11, 11, 'BaterÃa de NÃquel-Metal Hidruro', 'NiMH', 2),
(12, 12, 'BaterÃa de Litio', 'Li', 2),
(13, 13, 'BaterÃa de Plata-Óxido', 'SO(Z)', 2),
(14, 14, 'BaterÃa de Zinc-Carbón', 'CZ', 2),
(19, 19, 'BaterÃa Alcalina', 'Alkaline', 2),
(20, 20, 'Cartón Ondulado', 'PAP', 3),
(21, 21, 'Cartón Ondulado( de papel)', 'PAP', 3),
(22, 22, 'Papel', 'PAP', 3),
(40, 40, 'Acero', 'FE', 4),
(41, 41, 'Aluminio', 'ALU', 4),
(50, 50, 'Madera', 'FOR', 5),
(51, 51, 'Corcho', 'FOR', 5),
(60, 60, 'Algodón', 'COT', 5),
(61, 61, 'Fibra', 'TEX', 5),
(70, 70, 'Mezcla de cristales', 'GLS', 6),
(71, 71, 'Vidrio Claro', 'GLS', 6),
(72, 72, 'Vidrio Verde', 'GLS', 6),
(73, 73, 'Vidrio Oscuro', 'GLS', 6),
(74, 74, 'Vidrio', 'GLS', 6),
(75, 75, 'Vidrio', 'GLS', 6),
(76, 76, 'Vidrio', 'GLS', 6),
(77, 77, 'Vidrio con Bronze', 'GLS', 6),
(78, 78, 'Vidrio con Plata', 'GLS', 6),
(79, 79, 'Vidrio Dorado', 'GLS', 6),
(81, 81, 'papel más plástico', 'PapPet', 7),
(82, 82, 'Papel y Fibra / Aluminio', 'ALU/PAP', 7),
(83, 83, 'Lata', 'PAP (fibra', 7),
(84, 84, 'Plástico / Aluminio', 'C/PAP (o P', 7),
(85, 85, 'Plástico / Aluminio / Hojalata', 'ALU/PL', 7),
(87, 87, 'Plástico Biodegradable', '#87 Card-s', 7),
(90, 90, 'Plástico', '#90', 7),
(91, 91, 'Plástico / Aluminio', '#91', 7),
(92, 92, 'Plástico / Metales', '#92', 7),
(95, 95, 'Vidrio / Plástico', '#95', 7),
(96, 96, 'Cristal / Aluminio', '#96', 7),
(97, 97, 'Cristal / Hojalata', '#97', 7),
(98, 98, 'Cristal / Metales', '#98', 7);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `materials`
--
CREATE TABLE `materials` (
`id_material` int(11) NOT NULL,
`nameMaterial` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `materials`
--
INSERT INTO `materials` (`id_material`, `nameMaterial`) VALUES
(1, 'Plástico'),
(2, 'Pilas'),
(3, 'Papel'),
(4, 'Metal'),
(5, 'Residuos Biodegradables'),
(6, 'Vidrio'),
(7, 'Material Compuesto');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `material_products`
--
CREATE TABLE `material_products` (
`id_matProducts` int(11) NOT NULL,
`idProduct` int(11) NOT NULL,
`idContainer` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `material_products`
--
INSERT INTO `material_products` (`id_matProducts`, `idProduct`, `idContainer`) VALUES
(1, 1, 41),
(2, 6, 1),
(3, 5, 1),
(4, 11, 1),
(5, 3, 1),
(6, 4, 1),
(7, 33, 2);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `products`
--
CREATE TABLE `products` (
`id_Product` int(11) NOT NULL,
`nameProduct` varchar(256) NOT NULL,
`barCodeEAN` varchar(13) NOT NULL,
`imgProduct` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `products`
--
INSERT INTO `products` (`id_Product`, `nameProduct`, `barCodeEAN`, `imgProduct`) VALUES
(1, 'Rockstar Original Energy Drink 250ml', '8410409016502', 'p1.jpg'),
(2, 'Lays Gourmet Crema de Queso y Cebolla Caramelizada 150gr', '8410199017901', 'p2.jpg'),
(3, 'Agua Mineral Natural Sant Aniol 1.5L', '8424372021500', 'p3.jpg'),
(4, 'Agua Natural Font Vella 50cL', '8410055050011', 'p4.jpg'),
(5, 'Agua Mineral Font Agudes 1.5L', '8413334015169', 'p5.jpg'),
(6, 'Agua Mineral Natural Viladrau 50cL', '8411002101800', 'p6.jpg'),
(7, 'Fanta Limón 33cL', '5449000006004', 'p7.jpg'),
(8, 'Coca-Cola 33cL', '5449000000996', 'p8.jpg'),
(9, 'Fanta Naranja 33cL', '5449000011527', 'p9.jpg'),
(10, 'Coca-Cola Zero Azúcares 33cL', '5449000131805', 'p10.jpg'),
(11, 'Agua Mineral Natural Aguadoy 1.5L', '8437003011504', 'p11.jpg'),
(12, 'Chocolate extrafino con leche Hacendado pack 2u 150gr', '8480000121080', 'p12.jpg'),
(13, 'Fanta Naranja Zero Azúcares 33cL', '5449000120960', 'p13.jpg'),
(14, 'Fanta Limón Zero Azúcares 33cL', '5449000120991', 'p14.jpg'),
(15, 'Salsa Mostaza Leo Boeck 250mL', '8436569666012', 'p15.jpg'),
(16, 'Salsa Ketchup Leo Boeck 250mL', '8436569666005', 'p16.jpg'),
(17, 'Doritos Tex Mex 280gr', '8410199980755', 'p17.jpg'),
(33, 'Liposan Original Protector Labial', '4005900196439', 'p18.jpg');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `containers`
--
ALTER TABLE `containers`
ADD PRIMARY KEY (`id_container`),
ADD UNIQUE KEY `numberContainer` (`numberContainer`),
ADD KEY `typeContainer` (`idMaterial`);
--
-- Indices de la tabla `materials`
--
ALTER TABLE `materials`
ADD PRIMARY KEY (`id_material`);
--
-- Indices de la tabla `material_products`
--
ALTER TABLE `material_products`
ADD PRIMARY KEY (`id_matProducts`),
ADD KEY `idProduct` (`idProduct`),
ADD KEY `idContainer` (`idContainer`);
--
-- Indices de la tabla `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id_Product`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `containers`
--
ALTER TABLE `containers`
MODIFY `id_container` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=80;
--
-- AUTO_INCREMENT de la tabla `materials`
--
ALTER TABLE `materials`
MODIFY `id_material` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT de la tabla `material_products`
--
ALTER TABLE `material_products`
MODIFY `id_matProducts` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT de la tabla `products`
--
ALTER TABLE `products`
MODIFY `id_Product` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `containers`
--
ALTER TABLE `containers`
ADD CONSTRAINT `containers_ibfk_1` FOREIGN KEY (`idMaterial`) REFERENCES `materials` (`id_material`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `material_products`
--
ALTER TABLE `material_products`
ADD CONSTRAINT `material_products_ibfk_1` FOREIGN KEY (`idProduct`) REFERENCES `products` (`id_Product`) ON UPDATE CASCADE,
ADD CONSTRAINT `material_products_ibfk_2` FOREIGN KEY (`idContainer`) REFERENCES `containers` (`id_container`) ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;