-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexiastore.sql
399 lines (319 loc) · 12.9 KB
/
exiastore.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le : Lun 07 Juillet 2014 à 14:45
-- Version du serveur: 5.5.20
-- Version de PHP: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Base de données: `exiastore`
--
-- --------------------------------------------------------
--
-- Structure de la table `address`
--
CREATE TABLE IF NOT EXISTS `address` (
`IDADRESS` int(11) NOT NULL AUTO_INCREMENT,
`IDCITY` int(11) NOT NULL,
`ADDRESS1` text,
`ADDRESS2` text,
PRIMARY KEY (`IDADRESS`),
KEY `FK_HAVE1` (`IDCITY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `address`
--
INSERT INTO `address` (`IDADRESS`, `IDCITY`, `ADDRESS1`, `ADDRESS2`) VALUES
(1, 2, '67 rue du maurian', ''),
(2, 2, '67 rue du maurian', '');
-- --------------------------------------------------------
--
-- Structure de la table `articles`
--
CREATE TABLE IF NOT EXISTS `articles` (
`IDARTICLE` int(11) NOT NULL AUTO_INCREMENT,
`IDARTICLESTATEMENT` int(11) NOT NULL,
`IDCATEGORY` int(11) NOT NULL,
`LABELARTICLE` text,
`DESCRIPTION` text,
`PRICE` float(8,2) DEFAULT NULL,
`QUANTITYSTOCK` decimal(8,0) DEFAULT NULL,
`DATECREATEARTICLE` date DEFAULT NULL,
`DATELASTMODIF` date DEFAULT NULL,
`THRESHOLDSTOCK` decimal(8,0) DEFAULT NULL,
`IMAGE` text,
PRIMARY KEY (`IDARTICLE`),
KEY `FK_BE` (`IDARTICLESTATEMENT`),
KEY `FK_BELONG_TO` (`IDCATEGORY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
--
-- Contenu de la table `articles`
--
INSERT INTO `articles` (`IDARTICLE`, `IDARTICLESTATEMENT`, `IDCATEGORY`, `LABELARTICLE`, `DESCRIPTION`, `PRICE`, `QUANTITYSTOCK`, `DATECREATEARTICLE`, `DATELASTMODIF`, `THRESHOLDSTOCK`, `IMAGE`) VALUES
(1, 1, 1, 'Games of Thrones S04', 'Game of Thrones is an American fantasy drama television series created for HBO by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin''s series of fantasy novels, the first of which is titled A Game of Thrones. Filmed in a Belfast studio and on location elsewhere in Northern Ireland, Malta, Scotland, Croatia, Iceland, the United States and Morocco, it premiered on HBO in the United States on April 17, 2011. Two days after the fourth season premiered in April 2014, HBO renewed Game of Thrones for a fifth and sixth season.', 15.00, '10', '2014-06-24', '2014-06-24', '5', 'http://www.contrepoints.org/wp-content/uploads/2014/06/game-of-thrones.jpg'),
(2, 1, 2, 'M3 SONO OP', 'Opening M3', 4.00, '10', '2014-06-24', '2014-06-24', '4', 'http://strawburry17.com/wp-content/uploads/2014/04/M3-TV-Commercial.jpg'),
(3, 3, 1, 'Monty Python', 'Monty Python and the Holy Grail is a 1975 British comedy film written and performed by the comedy group of Monty Python (Graham Chapman, John Cleese, Terry Gilliam, Eric Idle, Terry Jones and Michael Palin), as directed by Gilliam and Jones. It was conceived during the hiatus between the third and fourth series of their popular BBC television programme Monty Python''s Flying Circus.', 15.00, '10', '2014-06-24', '2014-06-24', '5', 'http://www.comedyquotes.tv/wp-content/uploads/2013/06/monty_python.jpg'),
(6, 2, 1, 'Man of Steel', 'Man of Steel is a 2013 superhero film based on the DC Comics character Superman, co-produced by Legendary Pictures and Syncopy Films, distributed by Warner Bros. It is the first installment in the DC Cinematic Universe.[6][7][8] Directed by Zack Snyder and written by David S. Goyer, the film stars Henry Cavill, Amy Adams, Michael Shannon, Kevin Costner, Diane Lane, Laurence Fishburne, and Russell Crowe. Man of Steel is a reboot of the Superman film series that portrays the character''s origin story.', 33.99, '20', '2014-06-25', '2014-06-25', '5', 'http://fourcolors.blogs.pressdemocrat.com/files/2013/06/2013_man_of_steel_movie-wide.jpg'),
(8, 2, 1, 'Black Sheep', 'Black Sheep is a New Zealand made comedy horror film written and directed by Jonathan King. The film''s "splatstick"-style was inspired by New Zealand director Peter Jackson''s movies like Braindead and Bad Taste', 9.99, '10', '2014-06-25', '2014-06-25', '5', 'http://fr.web.img5.acsta.net/medias/nmedia/18/63/78/85/18906698.jpg');
-- --------------------------------------------------------
--
-- Structure de la table `articlestatements`
--
CREATE TABLE IF NOT EXISTS `articlestatements` (
`IDARTICLESTATEMENT` int(11) NOT NULL AUTO_INCREMENT,
`ARTICLESTATEMENT` text,
PRIMARY KEY (`IDARTICLESTATEMENT`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Contenu de la table `articlestatements`
--
INSERT INTO `articlestatements` (`IDARTICLESTATEMENT`, `ARTICLESTATEMENT`) VALUES
(1, 'In stock'),
(2, 'New'),
(3, 'Out of stock');
-- --------------------------------------------------------
--
-- Structure de la table `booksellers`
--
CREATE TABLE IF NOT EXISTS `booksellers` (
`IDSELLER` int(11) NOT NULL AUTO_INCREMENT,
`LASTNAMESELLER` text,
`FIRSTNAMESELLER` text,
`USERNAMESELLER` text,
`PASSWORDSELLER` text,
PRIMARY KEY (`IDSELLER`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `booksellers`
--
INSERT INTO `booksellers` (`IDSELLER`, `LASTNAMESELLER`, `FIRSTNAMESELLER`, `USERNAMESELLER`, `PASSWORDSELLER`) VALUES
(1, 'Samuel', 'Bobo', 'sbobo', 'sbobo');
-- --------------------------------------------------------
--
-- Structure de la table `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`IDCATEGORY` int(11) NOT NULL AUTO_INCREMENT,
`NAMECATEGORY` text,
PRIMARY KEY (`IDCATEGORY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `categories`
--
INSERT INTO `categories` (`IDCATEGORY`, `NAMECATEGORY`) VALUES
(1, 'DVD'),
(2, 'CD');
-- --------------------------------------------------------
--
-- Structure de la table `city`
--
CREATE TABLE IF NOT EXISTS `city` (
`IDCITY` int(11) NOT NULL AUTO_INCREMENT,
`CITY` text,
`ZIPCODE` decimal(8,0) DEFAULT NULL,
`COUNTRY` text,
PRIMARY KEY (`IDCITY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `city`
--
INSERT INTO `city` (`IDCITY`, `CITY`, `ZIPCODE`, `COUNTRY`) VALUES
(1, 'Bordeaux', '33000', 'France'),
(2, 'Blanquefort', '33290', 'France');
-- --------------------------------------------------------
--
-- Structure de la table `civility`
--
CREATE TABLE IF NOT EXISTS `civility` (
`IDCIVILITY` int(11) NOT NULL AUTO_INCREMENT,
`NAMECIVILITY` text,
PRIMARY KEY (`IDCIVILITY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `civility`
--
INSERT INTO `civility` (`IDCIVILITY`, `NAMECIVILITY`) VALUES
(1, 'Mrs.'),
(2, 'Mr.');
-- --------------------------------------------------------
--
-- Structure de la table `contain`
--
CREATE TABLE IF NOT EXISTS `contain` (
`IDORDER` int(11) NOT NULL,
`IDARTICLE` int(11) NOT NULL,
`IDTVA` int(11) NOT NULL,
`QUANTITYORDER` decimal(8,0) DEFAULT NULL,
`UNITARYPRICE` decimal(8,0) DEFAULT NULL,
PRIMARY KEY (`IDORDER`,`IDARTICLE`,`IDTVA`),
KEY `FK_CONTAIN2` (`IDARTICLE`),
KEY `FK_CONTAIN3` (`IDTVA`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `customers`
--
CREATE TABLE IF NOT EXISTS `customers` (
`IDCUSTOMER` int(11) NOT NULL AUTO_INCREMENT,
`IDCIVILITY` int(11) NOT NULL,
`IDADRESS` int(11) NOT NULL,
`USERNAME` text,
`PASSWORD` text,
`LASTNAME` text,
`FIRSTNAME` text,
`EMAIL` text,
PRIMARY KEY (`IDCUSTOMER`),
KEY `FK_IS` (`IDCIVILITY`),
KEY `FK_LIVE` (`IDADRESS`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `customers`
--
INSERT INTO `customers` (`IDCUSTOMER`, `IDCIVILITY`, `IDADRESS`, `USERNAME`, `PASSWORD`, `LASTNAME`, `FIRSTNAME`, `EMAIL`) VALUES
(1, 1, 1, 'Fenris', 'sam', 'Samuel', 'Bob', '[email protected]');
-- --------------------------------------------------------
--
-- Structure de la table `opinion`
--
CREATE TABLE IF NOT EXISTS `opinion` (
`IDARTICLE` int(11) NOT NULL,
`IDCUSTOMER` int(11) NOT NULL,
`NOTE` decimal(8,0) DEFAULT NULL,
`CONTENT` text,
PRIMARY KEY (`IDARTICLE`,`IDCUSTOMER`),
KEY `FK_OPINION2` (`IDCUSTOMER`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `orders`
--
CREATE TABLE IF NOT EXISTS `orders` (
`IDORDER` int(11) NOT NULL AUTO_INCREMENT,
`IDORDERSTATEMENT` int(11) NOT NULL,
`IDCUSTOMER` int(11) NOT NULL,
`DATEORDER` datetime DEFAULT NULL,
`ADDRESS1ORDER` text,
`ADDRESS2ORDER` text,
`CITYORDER` text,
`ZIPCODEORDER` decimal(8,0) DEFAULT NULL,
`COUNTRYORDER` text,
`DATEPAYMENTORDER` date DEFAULT NULL,
PRIMARY KEY (`IDORDER`),
KEY `FK_HAS_1` (`IDORDERSTATEMENT`),
KEY `FK_ORDER` (`IDCUSTOMER`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `orderstatements`
--
CREATE TABLE IF NOT EXISTS `orderstatements` (
`IDORDERSTATEMENT` int(11) NOT NULL AUTO_INCREMENT,
`ORDERSTATEMENT` text,
PRIMARY KEY (`IDORDERSTATEMENT`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Contenu de la table `orderstatements`
--
INSERT INTO `orderstatements` (`IDORDERSTATEMENT`, `ORDERSTATEMENT`) VALUES
(1, 'In preparation'),
(2, 'Pending'),
(3, 'int routing');
-- --------------------------------------------------------
--
-- Structure de la table `specifications`
--
CREATE TABLE IF NOT EXISTS `specifications` (
`IDSPECIFICATIONS` int(11) NOT NULL AUTO_INCREMENT,
`IDARTICLE` int(11) NOT NULL,
`IDTYPE` int(11) NOT NULL,
`CONTENTSPECIFICATIONS` varchar(500) DEFAULT NULL,
PRIMARY KEY (`IDSPECIFICATIONS`),
KEY `FK_DISPOSE` (`IDTYPE`),
KEY `FK_POSSESS` (`IDARTICLE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `specifications`
--
INSERT INTO `specifications` (`IDSPECIFICATIONS`, `IDARTICLE`, `IDTYPE`, `CONTENTSPECIFICATIONS`) VALUES
(1, 1, 1, 'La suite du livre');
-- --------------------------------------------------------
--
-- Structure de la table `tva`
--
CREATE TABLE IF NOT EXISTS `tva` (
`IDTVA` int(11) NOT NULL AUTO_INCREMENT,
`RATE` decimal(8,0) DEFAULT NULL,
PRIMARY KEY (`IDTVA`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `type`
--
CREATE TABLE IF NOT EXISTS `type` (
`IDTYPE` int(11) NOT NULL AUTO_INCREMENT,
`LABELTYPE` varchar(50) DEFAULT NULL,
PRIMARY KEY (`IDTYPE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Contenu de la table `type`
--
INSERT INTO `type` (`IDTYPE`, `LABELTYPE`) VALUES
(1, 'Descriptive'),
(2, 'Writer'),
(3, 'Producer'),
(4, 'Director');
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `address`
--
ALTER TABLE `address`
ADD CONSTRAINT `FK_HAVE1` FOREIGN KEY (`IDCITY`) REFERENCES `city` (`IDCITY`);
--
-- Contraintes pour la table `articles`
--
ALTER TABLE `articles`
ADD CONSTRAINT `FK_BE` FOREIGN KEY (`IDARTICLESTATEMENT`) REFERENCES `articlestatements` (`IDARTICLESTATEMENT`),
ADD CONSTRAINT `FK_BELONG_TO` FOREIGN KEY (`IDCATEGORY`) REFERENCES `categories` (`IDCATEGORY`);
--
-- Contraintes pour la table `contain`
--
ALTER TABLE `contain`
ADD CONSTRAINT `FK_CONTAIN` FOREIGN KEY (`IDORDER`) REFERENCES `orders` (`IDORDER`),
ADD CONSTRAINT `FK_CONTAIN2` FOREIGN KEY (`IDARTICLE`) REFERENCES `articles` (`IDARTICLE`),
ADD CONSTRAINT `FK_CONTAIN3` FOREIGN KEY (`IDTVA`) REFERENCES `tva` (`IDTVA`);
--
-- Contraintes pour la table `customers`
--
ALTER TABLE `customers`
ADD CONSTRAINT `FK_IS` FOREIGN KEY (`IDCIVILITY`) REFERENCES `civility` (`IDCIVILITY`),
ADD CONSTRAINT `FK_LIVE` FOREIGN KEY (`IDADRESS`) REFERENCES `address` (`IDADRESS`);
--
-- Contraintes pour la table `opinion`
--
ALTER TABLE `opinion`
ADD CONSTRAINT `FK_OPINION` FOREIGN KEY (`IDARTICLE`) REFERENCES `articles` (`IDARTICLE`),
ADD CONSTRAINT `FK_OPINION2` FOREIGN KEY (`IDCUSTOMER`) REFERENCES `customers` (`IDCUSTOMER`);
--
-- Contraintes pour la table `orders`
--
ALTER TABLE `orders`
ADD CONSTRAINT `FK_HAS_1` FOREIGN KEY (`IDORDERSTATEMENT`) REFERENCES `orderstatements` (`IDORDERSTATEMENT`),
ADD CONSTRAINT `FK_ORDER` FOREIGN KEY (`IDCUSTOMER`) REFERENCES `customers` (`IDCUSTOMER`);
--
-- Contraintes pour la table `specifications`
--
ALTER TABLE `specifications`
ADD CONSTRAINT `FK_DISPOSE` FOREIGN KEY (`IDTYPE`) REFERENCES `type` (`IDTYPE`),
ADD CONSTRAINT `FK_POSSESS` FOREIGN KEY (`IDARTICLE`) REFERENCES `articles` (`IDARTICLE`);
/*!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 */;