1
-- MySQL dump 10.13 Distrib 5.1.53, for apple-darwin10.3.0 (i386)
3
-- Host: localhost Database: sakila
4
-- ------------------------------------------------------
5
-- Server version 5.1.53-log
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 */;
19
-- Current Database: `sakila`
22
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `sakila` /*!40100 DEFAULT CHARACTER SET latin1 */;
27
-- Table structure for table `actor`
30
DROP TABLE IF EXISTS `actor`;
31
/*!40101 SET @saved_cs_client = @@character_set_client */;
32
/*!40101 SET character_set_client = utf8 */;
33
CREATE TABLE `actor` (
34
`actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
35
`first_name` varchar(45) NOT NULL,
36
`last_name` varchar(45) NOT NULL,
37
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
38
PRIMARY KEY (`actor_id`),
39
KEY `idx_actor_last_name` (`last_name`)
40
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8;
41
/*!40101 SET character_set_client = @saved_cs_client */;
44
-- Temporary table structure for view `actor_info`
47
DROP TABLE IF EXISTS `actor_info`;
48
/*!50001 DROP VIEW IF EXISTS `actor_info`*/;
49
SET @saved_cs_client = @@character_set_client;
50
SET character_set_client = utf8;
51
/*!50001 CREATE TABLE `actor_info` (
52
`actor_id` smallint(5) unsigned,
53
`first_name` varchar(45),
54
`last_name` varchar(45),
55
`film_info` varchar(341)
57
SET character_set_client = @saved_cs_client;
60
-- Table structure for table `address`
63
DROP TABLE IF EXISTS `address`;
64
/*!40101 SET @saved_cs_client = @@character_set_client */;
65
/*!40101 SET character_set_client = utf8 */;
66
CREATE TABLE `address` (
67
`address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
68
`address` varchar(50) NOT NULL,
69
`address2` varchar(50) DEFAULT NULL,
70
`district` varchar(20) NOT NULL,
71
`city_id` smallint(5) unsigned NOT NULL,
72
`postal_code` varchar(10) DEFAULT NULL,
73
`phone` varchar(20) NOT NULL,
74
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
75
PRIMARY KEY (`address_id`),
76
KEY `idx_fk_city_id` (`city_id`),
77
CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE
78
) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8;
79
/*!40101 SET character_set_client = @saved_cs_client */;
82
-- Table structure for table `category`
85
DROP TABLE IF EXISTS `category`;
86
/*!40101 SET @saved_cs_client = @@character_set_client */;
87
/*!40101 SET character_set_client = utf8 */;
88
CREATE TABLE `category` (
89
`category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
90
`name` varchar(25) NOT NULL,
91
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
92
PRIMARY KEY (`category_id`)
93
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
94
/*!40101 SET character_set_client = @saved_cs_client */;
97
-- Table structure for table `city`
100
DROP TABLE IF EXISTS `city`;
101
/*!40101 SET @saved_cs_client = @@character_set_client */;
102
/*!40101 SET character_set_client = utf8 */;
103
CREATE TABLE `city` (
104
`city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
105
`city` varchar(50) NOT NULL,
106
`country_id` smallint(5) unsigned NOT NULL,
107
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
108
PRIMARY KEY (`city_id`),
109
KEY `idx_fk_country_id` (`country_id`),
110
CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE
111
) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8;
112
/*!40101 SET character_set_client = @saved_cs_client */;
115
-- Table structure for table `country`
118
DROP TABLE IF EXISTS `country`;
119
/*!40101 SET @saved_cs_client = @@character_set_client */;
120
/*!40101 SET character_set_client = utf8 */;
121
CREATE TABLE `country` (
122
`country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
123
`country` varchar(50) NOT NULL,
124
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
125
PRIMARY KEY (`country_id`)
126
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8;
127
/*!40101 SET character_set_client = @saved_cs_client */;
130
-- Table structure for table `customer`
133
DROP TABLE IF EXISTS `customer`;
134
/*!40101 SET @saved_cs_client = @@character_set_client */;
135
/*!40101 SET character_set_client = utf8 */;
136
CREATE TABLE `customer` (
137
`customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
138
`store_id` tinyint(3) unsigned NOT NULL,
139
`first_name` varchar(45) NOT NULL,
140
`last_name` varchar(45) NOT NULL,
141
`email` varchar(50) DEFAULT NULL,
142
`address_id` smallint(5) unsigned NOT NULL,
143
`active` tinyint(1) NOT NULL DEFAULT '1',
144
`create_date` datetime NOT NULL,
145
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
146
PRIMARY KEY (`customer_id`),
147
KEY `idx_fk_store_id` (`store_id`),
148
KEY `idx_fk_address_id` (`address_id`),
149
KEY `idx_last_name` (`last_name`),
150
CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE,
151
CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE
152
) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8;
153
/*!40101 SET character_set_client = @saved_cs_client */;
154
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
155
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
156
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
157
/*!50003 SET character_set_client = latin1 */ ;
158
/*!50003 SET character_set_results = latin1 */ ;
159
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
160
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
161
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
163
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER customer_create_date BEFORE INSERT ON customer
164
FOR EACH ROW SET NEW.create_date = NOW() */;;
166
/*!50003 SET sql_mode = @saved_sql_mode */ ;
167
/*!50003 SET character_set_client = @saved_cs_client */ ;
168
/*!50003 SET character_set_results = @saved_cs_results */ ;
169
/*!50003 SET collation_connection = @saved_col_connection */ ;
172
-- Temporary table structure for view `customer_list`
175
DROP TABLE IF EXISTS `customer_list`;
176
/*!50001 DROP VIEW IF EXISTS `customer_list`*/;
177
SET @saved_cs_client = @@character_set_client;
178
SET character_set_client = utf8;
179
/*!50001 CREATE TABLE `customer_list` (
180
`ID` smallint(5) unsigned,
182
`address` varchar(50),
183
`zip code` varchar(10),
186
`country` varchar(50),
188
`SID` tinyint(3) unsigned
190
SET character_set_client = @saved_cs_client;
193
-- Table structure for table `film`
196
DROP TABLE IF EXISTS `film`;
197
/*!40101 SET @saved_cs_client = @@character_set_client */;
198
/*!40101 SET character_set_client = utf8 */;
199
CREATE TABLE `film` (
200
`film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
201
`title` varchar(255) NOT NULL,
203
`release_year` year(4) DEFAULT NULL,
204
`language_id` tinyint(3) unsigned NOT NULL,
205
`original_language_id` tinyint(3) unsigned DEFAULT NULL,
206
`rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
207
`rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
208
`length` smallint(5) unsigned DEFAULT NULL,
209
`replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
210
`rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G',
211
`special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL,
212
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
213
PRIMARY KEY (`film_id`),
214
KEY `idx_title` (`title`),
215
KEY `idx_fk_language_id` (`language_id`),
216
KEY `idx_fk_original_language_id` (`original_language_id`),
217
CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE,
218
CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE
219
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8;
220
/*!40101 SET character_set_client = @saved_cs_client */;
221
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
222
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
223
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
224
/*!50003 SET character_set_client = latin1 */ ;
225
/*!50003 SET character_set_results = latin1 */ ;
226
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
227
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
228
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
230
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN
231
INSERT INTO film_text (film_id, title, description)
232
VALUES (new.film_id, new.title, new.description);
235
/*!50003 SET sql_mode = @saved_sql_mode */ ;
236
/*!50003 SET character_set_client = @saved_cs_client */ ;
237
/*!50003 SET character_set_results = @saved_cs_results */ ;
238
/*!50003 SET collation_connection = @saved_col_connection */ ;
239
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
240
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
241
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
242
/*!50003 SET character_set_client = latin1 */ ;
243
/*!50003 SET character_set_results = latin1 */ ;
244
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
245
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
246
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
248
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN
249
IF (old.title != new.title) or (old.description != new.description)
253
description=new.description,
255
WHERE film_id=old.film_id;
259
/*!50003 SET sql_mode = @saved_sql_mode */ ;
260
/*!50003 SET character_set_client = @saved_cs_client */ ;
261
/*!50003 SET character_set_results = @saved_cs_results */ ;
262
/*!50003 SET collation_connection = @saved_col_connection */ ;
263
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
264
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
265
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
266
/*!50003 SET character_set_client = latin1 */ ;
267
/*!50003 SET character_set_results = latin1 */ ;
268
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
269
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
270
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
272
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN
273
DELETE FROM film_text WHERE film_id = old.film_id;
276
/*!50003 SET sql_mode = @saved_sql_mode */ ;
277
/*!50003 SET character_set_client = @saved_cs_client */ ;
278
/*!50003 SET character_set_results = @saved_cs_results */ ;
279
/*!50003 SET collation_connection = @saved_col_connection */ ;
282
-- Table structure for table `film_actor`
285
DROP TABLE IF EXISTS `film_actor`;
286
/*!40101 SET @saved_cs_client = @@character_set_client */;
287
/*!40101 SET character_set_client = utf8 */;
288
CREATE TABLE `film_actor` (
289
`actor_id` smallint(5) unsigned NOT NULL,
290
`film_id` smallint(5) unsigned NOT NULL,
291
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
292
PRIMARY KEY (`actor_id`,`film_id`),
293
KEY `idx_fk_film_id` (`film_id`),
294
CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE,
295
CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
296
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
297
/*!40101 SET character_set_client = @saved_cs_client */;
300
-- Table structure for table `film_category`
303
DROP TABLE IF EXISTS `film_category`;
304
/*!40101 SET @saved_cs_client = @@character_set_client */;
305
/*!40101 SET character_set_client = utf8 */;
306
CREATE TABLE `film_category` (
307
`film_id` smallint(5) unsigned NOT NULL,
308
`category_id` tinyint(3) unsigned NOT NULL,
309
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
310
PRIMARY KEY (`film_id`,`category_id`),
311
KEY `fk_film_category_category` (`category_id`),
312
CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE,
313
CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE
314
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
315
/*!40101 SET character_set_client = @saved_cs_client */;
318
-- Temporary table structure for view `film_list`
321
DROP TABLE IF EXISTS `film_list`;
322
/*!50001 DROP VIEW IF EXISTS `film_list`*/;
323
SET @saved_cs_client = @@character_set_client;
324
SET character_set_client = utf8;
325
/*!50001 CREATE TABLE `film_list` (
326
`FID` smallint(5) unsigned,
327
`title` varchar(255),
329
`category` varchar(25),
330
`price` decimal(4,2),
331
`length` smallint(5) unsigned,
332
`rating` enum('G','PG','PG-13','R','NC-17'),
333
`actors` varchar(341)
335
SET character_set_client = @saved_cs_client;
338
-- Table structure for table `film_text`
341
DROP TABLE IF EXISTS `film_text`;
342
/*!40101 SET @saved_cs_client = @@character_set_client */;
343
/*!40101 SET character_set_client = utf8 */;
344
CREATE TABLE `film_text` (
345
`film_id` smallint(6) NOT NULL,
346
`title` varchar(255) NOT NULL,
348
PRIMARY KEY (`film_id`),
349
FULLTEXT KEY `idx_title_description` (`title`,`description`)
350
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
351
/*!40101 SET character_set_client = @saved_cs_client */;
354
-- Table structure for table `inventory`
357
DROP TABLE IF EXISTS `inventory`;
358
/*!40101 SET @saved_cs_client = @@character_set_client */;
359
/*!40101 SET character_set_client = utf8 */;
360
CREATE TABLE `inventory` (
361
`inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
362
`film_id` smallint(5) unsigned NOT NULL,
363
`store_id` tinyint(3) unsigned NOT NULL,
364
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
365
PRIMARY KEY (`inventory_id`),
366
KEY `idx_fk_film_id` (`film_id`),
367
KEY `idx_store_id_film_id` (`store_id`,`film_id`),
368
CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
369
CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
370
) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8;
371
/*!40101 SET character_set_client = @saved_cs_client */;
374
-- Table structure for table `language`
377
DROP TABLE IF EXISTS `language`;
378
/*!40101 SET @saved_cs_client = @@character_set_client */;
379
/*!40101 SET character_set_client = utf8 */;
380
CREATE TABLE `language` (
381
`language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
382
`name` char(20) NOT NULL,
383
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
384
PRIMARY KEY (`language_id`)
385
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
386
/*!40101 SET character_set_client = @saved_cs_client */;
389
-- Temporary table structure for view `nicer_but_slower_film_list`
392
DROP TABLE IF EXISTS `nicer_but_slower_film_list`;
393
/*!50001 DROP VIEW IF EXISTS `nicer_but_slower_film_list`*/;
394
SET @saved_cs_client = @@character_set_client;
395
SET character_set_client = utf8;
396
/*!50001 CREATE TABLE `nicer_but_slower_film_list` (
397
`FID` smallint(5) unsigned,
398
`title` varchar(255),
400
`category` varchar(25),
401
`price` decimal(4,2),
402
`length` smallint(5) unsigned,
403
`rating` enum('G','PG','PG-13','R','NC-17'),
404
`actors` varchar(341)
406
SET character_set_client = @saved_cs_client;
409
-- Table structure for table `payment`
412
DROP TABLE IF EXISTS `payment`;
413
/*!40101 SET @saved_cs_client = @@character_set_client */;
414
/*!40101 SET character_set_client = utf8 */;
415
CREATE TABLE `payment` (
416
`payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
417
`customer_id` smallint(5) unsigned NOT NULL,
418
`staff_id` tinyint(3) unsigned NOT NULL,
419
`rental_id` int(11) DEFAULT NULL,
420
`amount` decimal(5,2) NOT NULL,
421
`payment_date` datetime NOT NULL,
422
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
423
PRIMARY KEY (`payment_id`),
424
KEY `idx_fk_staff_id` (`staff_id`),
425
KEY `idx_fk_customer_id` (`customer_id`),
426
KEY `fk_payment_rental` (`rental_id`),
427
CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE,
428
CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
429
CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
430
) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8;
431
/*!40101 SET character_set_client = @saved_cs_client */;
432
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
433
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
434
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
435
/*!50003 SET character_set_client = latin1 */ ;
436
/*!50003 SET character_set_results = latin1 */ ;
437
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
438
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
439
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
441
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER payment_date BEFORE INSERT ON payment
442
FOR EACH ROW SET NEW.payment_date = NOW() */;;
444
/*!50003 SET sql_mode = @saved_sql_mode */ ;
445
/*!50003 SET character_set_client = @saved_cs_client */ ;
446
/*!50003 SET character_set_results = @saved_cs_results */ ;
447
/*!50003 SET collation_connection = @saved_col_connection */ ;
450
-- Table structure for table `rental`
453
DROP TABLE IF EXISTS `rental`;
454
/*!40101 SET @saved_cs_client = @@character_set_client */;
455
/*!40101 SET character_set_client = utf8 */;
456
CREATE TABLE `rental` (
457
`rental_id` int(11) NOT NULL AUTO_INCREMENT,
458
`rental_date` datetime NOT NULL,
459
`inventory_id` mediumint(8) unsigned NOT NULL,
460
`customer_id` smallint(5) unsigned NOT NULL,
461
`return_date` datetime DEFAULT NULL,
462
`staff_id` tinyint(3) unsigned NOT NULL,
463
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
464
PRIMARY KEY (`rental_id`),
465
UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`),
466
KEY `idx_fk_inventory_id` (`inventory_id`),
467
KEY `idx_fk_customer_id` (`customer_id`),
468
KEY `idx_fk_staff_id` (`staff_id`),
469
CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
470
CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE,
471
CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE
472
) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8;
473
/*!40101 SET character_set_client = @saved_cs_client */;
474
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
475
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
476
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
477
/*!50003 SET character_set_client = latin1 */ ;
478
/*!50003 SET character_set_results = latin1 */ ;
479
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
480
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
481
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
483
/*!50003 CREATE*/ /*!50017 DEFINER=`msandbox`@`%`*/ /*!50003 TRIGGER rental_date BEFORE INSERT ON rental
484
FOR EACH ROW SET NEW.rental_date = NOW() */;;
486
/*!50003 SET sql_mode = @saved_sql_mode */ ;
487
/*!50003 SET character_set_client = @saved_cs_client */ ;
488
/*!50003 SET character_set_results = @saved_cs_results */ ;
489
/*!50003 SET collation_connection = @saved_col_connection */ ;
492
-- Temporary table structure for view `sales_by_film_category`
495
DROP TABLE IF EXISTS `sales_by_film_category`;
496
/*!50001 DROP VIEW IF EXISTS `sales_by_film_category`*/;
497
SET @saved_cs_client = @@character_set_client;
498
SET character_set_client = utf8;
499
/*!50001 CREATE TABLE `sales_by_film_category` (
500
`category` varchar(25),
501
`total_sales` decimal(27,2)
503
SET character_set_client = @saved_cs_client;
506
-- Temporary table structure for view `sales_by_store`
509
DROP TABLE IF EXISTS `sales_by_store`;
510
/*!50001 DROP VIEW IF EXISTS `sales_by_store`*/;
511
SET @saved_cs_client = @@character_set_client;
512
SET character_set_client = utf8;
513
/*!50001 CREATE TABLE `sales_by_store` (
514
`store` varchar(101),
515
`manager` varchar(91),
516
`total_sales` decimal(27,2)
518
SET character_set_client = @saved_cs_client;
521
-- Table structure for table `staff`
524
DROP TABLE IF EXISTS `staff`;
525
/*!40101 SET @saved_cs_client = @@character_set_client */;
526
/*!40101 SET character_set_client = utf8 */;
527
CREATE TABLE `staff` (
528
`staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
529
`first_name` varchar(45) NOT NULL,
530
`last_name` varchar(45) NOT NULL,
531
`address_id` smallint(5) unsigned NOT NULL,
533
`email` varchar(50) DEFAULT NULL,
534
`store_id` tinyint(3) unsigned NOT NULL,
535
`active` tinyint(1) NOT NULL DEFAULT '1',
536
`username` varchar(16) NOT NULL,
537
`password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
538
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
539
PRIMARY KEY (`staff_id`),
540
KEY `idx_fk_store_id` (`store_id`),
541
KEY `idx_fk_address_id` (`address_id`),
542
CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
543
CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
544
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
545
/*!40101 SET character_set_client = @saved_cs_client */;
548
-- Temporary table structure for view `staff_list`
551
DROP TABLE IF EXISTS `staff_list`;
552
/*!50001 DROP VIEW IF EXISTS `staff_list`*/;
553
SET @saved_cs_client = @@character_set_client;
554
SET character_set_client = utf8;
555
/*!50001 CREATE TABLE `staff_list` (
556
`ID` tinyint(3) unsigned,
558
`address` varchar(50),
559
`zip code` varchar(10),
562
`country` varchar(50),
563
`SID` tinyint(3) unsigned
565
SET character_set_client = @saved_cs_client;
568
-- Table structure for table `store`
571
DROP TABLE IF EXISTS `store`;
572
/*!40101 SET @saved_cs_client = @@character_set_client */;
573
/*!40101 SET character_set_client = utf8 */;
574
CREATE TABLE `store` (
575
`store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
576
`manager_staff_id` tinyint(3) unsigned NOT NULL,
577
`address_id` smallint(5) unsigned NOT NULL,
578
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
579
PRIMARY KEY (`store_id`),
580
UNIQUE KEY `idx_unique_manager` (`manager_staff_id`),
581
KEY `idx_fk_address_id` (`address_id`),
582
CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
583
CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
584
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
585
/*!40101 SET character_set_client = @saved_cs_client */;
588
-- Current Database: `mysql`
591
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */;
596
-- Table structure for table `columns_priv`
599
DROP TABLE IF EXISTS `columns_priv`;
600
/*!40101 SET @saved_cs_client = @@character_set_client */;
601
/*!40101 SET character_set_client = utf8 */;
602
CREATE TABLE `columns_priv` (
603
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
604
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
605
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
606
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
607
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
608
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
609
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
610
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
611
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges';
612
/*!40101 SET character_set_client = @saved_cs_client */;
615
-- Table structure for table `db`
618
DROP TABLE IF EXISTS `db`;
619
/*!40101 SET @saved_cs_client = @@character_set_client */;
620
/*!40101 SET character_set_client = utf8 */;
622
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
623
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
624
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
625
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
626
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
627
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
628
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
629
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
630
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
631
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
632
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
633
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
634
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
635
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
636
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
637
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
638
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
639
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
640
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
641
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
642
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
643
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
644
PRIMARY KEY (`Host`,`Db`,`User`),
646
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges';
647
/*!40101 SET character_set_client = @saved_cs_client */;
650
-- Table structure for table `event`
653
DROP TABLE IF EXISTS `event`;
654
/*!40101 SET @saved_cs_client = @@character_set_client */;
655
/*!40101 SET character_set_client = utf8 */;
656
CREATE TABLE `event` (
657
`db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
658
`name` char(64) NOT NULL DEFAULT '',
659
`body` longblob NOT NULL,
660
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
661
`execute_at` datetime DEFAULT NULL,
662
`interval_value` int(11) DEFAULT NULL,
663
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
664
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
665
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
666
`last_executed` datetime DEFAULT NULL,
667
`starts` datetime DEFAULT NULL,
668
`ends` datetime DEFAULT NULL,
669
`status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
670
`on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
671
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
672
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
673
`originator` int(10) unsigned NOT NULL,
674
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
675
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
676
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
677
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
678
`body_utf8` longblob,
679
PRIMARY KEY (`db`,`name`)
680
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events';
681
/*!40101 SET character_set_client = @saved_cs_client */;
684
-- Table structure for table `func`
687
DROP TABLE IF EXISTS `func`;
688
/*!40101 SET @saved_cs_client = @@character_set_client */;
689
/*!40101 SET character_set_client = utf8 */;
690
CREATE TABLE `func` (
691
`name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
692
`ret` tinyint(1) NOT NULL DEFAULT '0',
693
`dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
694
`type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
696
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions';
697
/*!40101 SET character_set_client = @saved_cs_client */;
700
-- Table structure for table `help_category`
703
DROP TABLE IF EXISTS `help_category`;
704
/*!40101 SET @saved_cs_client = @@character_set_client */;
705
/*!40101 SET character_set_client = utf8 */;
706
CREATE TABLE `help_category` (
707
`help_category_id` smallint(5) unsigned NOT NULL,
708
`name` char(64) NOT NULL,
709
`parent_category_id` smallint(5) unsigned DEFAULT NULL,
710
`url` char(128) NOT NULL,
711
PRIMARY KEY (`help_category_id`),
712
UNIQUE KEY `name` (`name`)
713
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories';
714
/*!40101 SET character_set_client = @saved_cs_client */;
717
-- Table structure for table `help_keyword`
720
DROP TABLE IF EXISTS `help_keyword`;
721
/*!40101 SET @saved_cs_client = @@character_set_client */;
722
/*!40101 SET character_set_client = utf8 */;
723
CREATE TABLE `help_keyword` (
724
`help_keyword_id` int(10) unsigned NOT NULL,
725
`name` char(64) NOT NULL,
726
PRIMARY KEY (`help_keyword_id`),
727
UNIQUE KEY `name` (`name`)
728
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords';
729
/*!40101 SET character_set_client = @saved_cs_client */;
732
-- Table structure for table `help_relation`
735
DROP TABLE IF EXISTS `help_relation`;
736
/*!40101 SET @saved_cs_client = @@character_set_client */;
737
/*!40101 SET character_set_client = utf8 */;
738
CREATE TABLE `help_relation` (
739
`help_topic_id` int(10) unsigned NOT NULL,
740
`help_keyword_id` int(10) unsigned NOT NULL,
741
PRIMARY KEY (`help_keyword_id`,`help_topic_id`)
742
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation';
743
/*!40101 SET character_set_client = @saved_cs_client */;
746
-- Table structure for table `help_topic`
749
DROP TABLE IF EXISTS `help_topic`;
750
/*!40101 SET @saved_cs_client = @@character_set_client */;
751
/*!40101 SET character_set_client = utf8 */;
752
CREATE TABLE `help_topic` (
753
`help_topic_id` int(10) unsigned NOT NULL,
754
`name` char(64) NOT NULL,
755
`help_category_id` smallint(5) unsigned NOT NULL,
756
`description` text NOT NULL,
757
`example` text NOT NULL,
758
`url` char(128) NOT NULL,
759
PRIMARY KEY (`help_topic_id`),
760
UNIQUE KEY `name` (`name`)
761
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics';
762
/*!40101 SET character_set_client = @saved_cs_client */;
765
-- Table structure for table `host`
768
DROP TABLE IF EXISTS `host`;
769
/*!40101 SET @saved_cs_client = @@character_set_client */;
770
/*!40101 SET character_set_client = utf8 */;
771
CREATE TABLE `host` (
772
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
773
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
774
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
775
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
776
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
777
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
778
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
779
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
780
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
781
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
782
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
783
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
784
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
785
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
786
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
787
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
788
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
789
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
790
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
791
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
792
PRIMARY KEY (`Host`,`Db`)
793
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges';
794
/*!40101 SET character_set_client = @saved_cs_client */;
797
-- Table structure for table `ndb_binlog_index`
800
DROP TABLE IF EXISTS `ndb_binlog_index`;
801
/*!40101 SET @saved_cs_client = @@character_set_client */;
802
/*!40101 SET character_set_client = utf8 */;
803
CREATE TABLE `ndb_binlog_index` (
804
`Position` bigint(20) unsigned NOT NULL,
805
`File` varchar(255) NOT NULL,
806
`epoch` bigint(20) unsigned NOT NULL,
807
`inserts` bigint(20) unsigned NOT NULL,
808
`updates` bigint(20) unsigned NOT NULL,
809
`deletes` bigint(20) unsigned NOT NULL,
810
`schemaops` bigint(20) unsigned NOT NULL,
811
PRIMARY KEY (`epoch`)
812
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
813
/*!40101 SET character_set_client = @saved_cs_client */;
816
-- Table structure for table `plugin`
819
DROP TABLE IF EXISTS `plugin`;
820
/*!40101 SET @saved_cs_client = @@character_set_client */;
821
/*!40101 SET character_set_client = utf8 */;
822
CREATE TABLE `plugin` (
823
`name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
824
`dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
826
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';
827
/*!40101 SET character_set_client = @saved_cs_client */;
830
-- Table structure for table `proc`
833
DROP TABLE IF EXISTS `proc`;
834
/*!40101 SET @saved_cs_client = @@character_set_client */;
835
/*!40101 SET character_set_client = utf8 */;
836
CREATE TABLE `proc` (
837
`db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
838
`name` char(64) NOT NULL DEFAULT '',
839
`type` enum('FUNCTION','PROCEDURE') NOT NULL,
840
`specific_name` char(64) NOT NULL DEFAULT '',
841
`language` enum('SQL') NOT NULL DEFAULT 'SQL',
842
`sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
843
`is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
844
`security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
845
`param_list` blob NOT NULL,
846
`returns` longblob NOT NULL,
847
`body` longblob NOT NULL,
848
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
849
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
850
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
851
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
852
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
853
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
854
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
855
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
856
`body_utf8` longblob,
857
PRIMARY KEY (`db`,`name`,`type`)
858
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures';
859
/*!40101 SET character_set_client = @saved_cs_client */;
862
-- Table structure for table `procs_priv`
865
DROP TABLE IF EXISTS `procs_priv`;
866
/*!40101 SET @saved_cs_client = @@character_set_client */;
867
/*!40101 SET character_set_client = utf8 */;
868
CREATE TABLE `procs_priv` (
869
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
870
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
871
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
872
`Routine_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
873
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
874
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
875
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
876
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
877
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
878
KEY `Grantor` (`Grantor`)
879
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges';
880
/*!40101 SET character_set_client = @saved_cs_client */;
883
-- Table structure for table `servers`
886
DROP TABLE IF EXISTS `servers`;
887
/*!40101 SET @saved_cs_client = @@character_set_client */;
888
/*!40101 SET character_set_client = utf8 */;
889
CREATE TABLE `servers` (
890
`Server_name` char(64) NOT NULL DEFAULT '',
891
`Host` char(64) NOT NULL DEFAULT '',
892
`Db` char(64) NOT NULL DEFAULT '',
893
`Username` char(64) NOT NULL DEFAULT '',
894
`Password` char(64) NOT NULL DEFAULT '',
895
`Port` int(4) NOT NULL DEFAULT '0',
896
`Socket` char(64) NOT NULL DEFAULT '',
897
`Wrapper` char(64) NOT NULL DEFAULT '',
898
`Owner` char(64) NOT NULL DEFAULT '',
899
PRIMARY KEY (`Server_name`)
900
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';
901
/*!40101 SET character_set_client = @saved_cs_client */;
904
-- Table structure for table `tables_priv`
907
DROP TABLE IF EXISTS `tables_priv`;
908
/*!40101 SET @saved_cs_client = @@character_set_client */;
909
/*!40101 SET character_set_client = utf8 */;
910
CREATE TABLE `tables_priv` (
911
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
912
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
913
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
914
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
915
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
916
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
917
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
918
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
919
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
920
KEY `Grantor` (`Grantor`)
921
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges';
922
/*!40101 SET character_set_client = @saved_cs_client */;
925
-- Table structure for table `time_zone`
928
DROP TABLE IF EXISTS `time_zone`;
929
/*!40101 SET @saved_cs_client = @@character_set_client */;
930
/*!40101 SET character_set_client = utf8 */;
931
CREATE TABLE `time_zone` (
932
`Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
933
`Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
934
PRIMARY KEY (`Time_zone_id`)
935
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones';
936
/*!40101 SET character_set_client = @saved_cs_client */;
939
-- Table structure for table `time_zone_leap_second`
942
DROP TABLE IF EXISTS `time_zone_leap_second`;
943
/*!40101 SET @saved_cs_client = @@character_set_client */;
944
/*!40101 SET character_set_client = utf8 */;
945
CREATE TABLE `time_zone_leap_second` (
946
`Transition_time` bigint(20) NOT NULL,
947
`Correction` int(11) NOT NULL,
948
PRIMARY KEY (`Transition_time`)
949
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones';
950
/*!40101 SET character_set_client = @saved_cs_client */;
953
-- Table structure for table `time_zone_name`
956
DROP TABLE IF EXISTS `time_zone_name`;
957
/*!40101 SET @saved_cs_client = @@character_set_client */;
958
/*!40101 SET character_set_client = utf8 */;
959
CREATE TABLE `time_zone_name` (
960
`Name` char(64) NOT NULL,
961
`Time_zone_id` int(10) unsigned NOT NULL,
963
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names';
964
/*!40101 SET character_set_client = @saved_cs_client */;
967
-- Table structure for table `time_zone_transition`
970
DROP TABLE IF EXISTS `time_zone_transition`;
971
/*!40101 SET @saved_cs_client = @@character_set_client */;
972
/*!40101 SET character_set_client = utf8 */;
973
CREATE TABLE `time_zone_transition` (
974
`Time_zone_id` int(10) unsigned NOT NULL,
975
`Transition_time` bigint(20) NOT NULL,
976
`Transition_type_id` int(10) unsigned NOT NULL,
977
PRIMARY KEY (`Time_zone_id`,`Transition_time`)
978
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions';
979
/*!40101 SET character_set_client = @saved_cs_client */;
982
-- Table structure for table `time_zone_transition_type`
985
DROP TABLE IF EXISTS `time_zone_transition_type`;
986
/*!40101 SET @saved_cs_client = @@character_set_client */;
987
/*!40101 SET character_set_client = utf8 */;
988
CREATE TABLE `time_zone_transition_type` (
989
`Time_zone_id` int(10) unsigned NOT NULL,
990
`Transition_type_id` int(10) unsigned NOT NULL,
991
`Offset` int(11) NOT NULL DEFAULT '0',
992
`Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0',
993
`Abbreviation` char(8) NOT NULL DEFAULT '',
994
PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
995
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types';
996
/*!40101 SET character_set_client = @saved_cs_client */;
999
-- Table structure for table `user`
1002
DROP TABLE IF EXISTS `user`;
1003
/*!40101 SET @saved_cs_client = @@character_set_client */;
1004
/*!40101 SET character_set_client = utf8 */;
1005
CREATE TABLE `user` (
1006
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1007
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1008
`Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
1009
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1010
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1011
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1012
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1013
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1014
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1015
`Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1016
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1017
`Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1018
`File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1019
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1020
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1021
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1022
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1023
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1024
`Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1025
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1026
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1027
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1028
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1029
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1030
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1031
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1032
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1033
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1034
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1035
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1036
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1037
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
1038
`ssl_cipher` blob NOT NULL,
1039
`x509_issuer` blob NOT NULL,
1040
`x509_subject` blob NOT NULL,
1041
`max_questions` int(11) unsigned NOT NULL DEFAULT '0',
1042
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
1043
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
1044
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
1045
PRIMARY KEY (`Host`,`User`)
1046
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges';
1047
/*!40101 SET character_set_client = @saved_cs_client */;
1050
-- Current Database: `sakila`
1056
-- Final view structure for view `actor_info`
1059
/*!50001 DROP TABLE IF EXISTS `actor_info`*/;
1060
/*!50001 DROP VIEW IF EXISTS `actor_info`*/;
1061
/*!50001 SET @saved_cs_client = @@character_set_client */;
1062
/*!50001 SET @saved_cs_results = @@character_set_results */;
1063
/*!50001 SET @saved_col_connection = @@collation_connection */;
1064
/*!50001 SET character_set_client = latin1 */;
1065
/*!50001 SET character_set_results = latin1 */;
1066
/*!50001 SET collation_connection = latin1_swedish_ci */;
1067
/*!50001 CREATE ALGORITHM=UNDEFINED */
1068
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY INVOKER */
1069
/*!50001 VIEW `actor_info` AS select `a`.`actor_id` AS `actor_id`,`a`.`first_name` AS `first_name`,`a`.`last_name` AS `last_name`,group_concat(distinct concat(`c`.`name`,': ',(select group_concat(`f`.`title` order by `f`.`title` ASC separator ', ') from ((`film` `f` join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `film_actor` `fa` on((`f`.`film_id` = `fa`.`film_id`))) where ((`fc`.`category_id` = `c`.`category_id`) and (`fa`.`actor_id` = `a`.`actor_id`)))) order by `c`.`name` ASC separator '; ') AS `film_info` from (((`actor` `a` left join `film_actor` `fa` on((`a`.`actor_id` = `fa`.`actor_id`))) left join `film_category` `fc` on((`fa`.`film_id` = `fc`.`film_id`))) left join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `a`.`actor_id`,`a`.`first_name`,`a`.`last_name` */;
1070
/*!50001 SET character_set_client = @saved_cs_client */;
1071
/*!50001 SET character_set_results = @saved_cs_results */;
1072
/*!50001 SET collation_connection = @saved_col_connection */;
1075
-- Final view structure for view `customer_list`
1078
/*!50001 DROP TABLE IF EXISTS `customer_list`*/;
1079
/*!50001 DROP VIEW IF EXISTS `customer_list`*/;
1080
/*!50001 SET @saved_cs_client = @@character_set_client */;
1081
/*!50001 SET @saved_cs_results = @@character_set_results */;
1082
/*!50001 SET @saved_col_connection = @@collation_connection */;
1083
/*!50001 SET character_set_client = latin1 */;
1084
/*!50001 SET character_set_results = latin1 */;
1085
/*!50001 SET collation_connection = latin1_swedish_ci */;
1086
/*!50001 CREATE ALGORITHM=UNDEFINED */
1087
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1088
/*!50001 VIEW `customer_list` AS select `cu`.`customer_id` AS `ID`,concat(`cu`.`first_name`,_utf8' ',`cu`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,if(`cu`.`active`,_utf8'active',_utf8'') AS `notes`,`cu`.`store_id` AS `SID` from (((`customer` `cu` join `address` `a` on((`cu`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */;
1089
/*!50001 SET character_set_client = @saved_cs_client */;
1090
/*!50001 SET character_set_results = @saved_cs_results */;
1091
/*!50001 SET collation_connection = @saved_col_connection */;
1094
-- Final view structure for view `film_list`
1097
/*!50001 DROP TABLE IF EXISTS `film_list`*/;
1098
/*!50001 DROP VIEW IF EXISTS `film_list`*/;
1099
/*!50001 SET @saved_cs_client = @@character_set_client */;
1100
/*!50001 SET @saved_cs_results = @@character_set_results */;
1101
/*!50001 SET @saved_col_connection = @@collation_connection */;
1102
/*!50001 SET character_set_client = latin1 */;
1103
/*!50001 SET character_set_results = latin1 */;
1104
/*!50001 SET collation_connection = latin1_swedish_ci */;
1105
/*!50001 CREATE ALGORITHM=UNDEFINED */
1106
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1107
/*!50001 VIEW `film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(`actor`.`first_name`,_utf8' ',`actor`.`last_name`) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */;
1108
/*!50001 SET character_set_client = @saved_cs_client */;
1109
/*!50001 SET character_set_results = @saved_cs_results */;
1110
/*!50001 SET collation_connection = @saved_col_connection */;
1113
-- Final view structure for view `nicer_but_slower_film_list`
1116
/*!50001 DROP TABLE IF EXISTS `nicer_but_slower_film_list`*/;
1117
/*!50001 DROP VIEW IF EXISTS `nicer_but_slower_film_list`*/;
1118
/*!50001 SET @saved_cs_client = @@character_set_client */;
1119
/*!50001 SET @saved_cs_results = @@character_set_results */;
1120
/*!50001 SET @saved_col_connection = @@collation_connection */;
1121
/*!50001 SET character_set_client = latin1 */;
1122
/*!50001 SET character_set_results = latin1 */;
1123
/*!50001 SET collation_connection = latin1_swedish_ci */;
1124
/*!50001 CREATE ALGORITHM=UNDEFINED */
1125
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1126
/*!50001 VIEW `nicer_but_slower_film_list` AS select `film`.`film_id` AS `FID`,`film`.`title` AS `title`,`film`.`description` AS `description`,`category`.`name` AS `category`,`film`.`rental_rate` AS `price`,`film`.`length` AS `length`,`film`.`rating` AS `rating`,group_concat(concat(concat(ucase(substr(`actor`.`first_name`,1,1)),lcase(substr(`actor`.`first_name`,2,length(`actor`.`first_name`))),_utf8' ',concat(ucase(substr(`actor`.`last_name`,1,1)),lcase(substr(`actor`.`last_name`,2,length(`actor`.`last_name`)))))) separator ', ') AS `actors` from ((((`category` left join `film_category` on((`category`.`category_id` = `film_category`.`category_id`))) left join `film` on((`film_category`.`film_id` = `film`.`film_id`))) join `film_actor` on((`film`.`film_id` = `film_actor`.`film_id`))) join `actor` on((`film_actor`.`actor_id` = `actor`.`actor_id`))) group by `film`.`film_id` */;
1127
/*!50001 SET character_set_client = @saved_cs_client */;
1128
/*!50001 SET character_set_results = @saved_cs_results */;
1129
/*!50001 SET collation_connection = @saved_col_connection */;
1132
-- Final view structure for view `sales_by_film_category`
1135
/*!50001 DROP TABLE IF EXISTS `sales_by_film_category`*/;
1136
/*!50001 DROP VIEW IF EXISTS `sales_by_film_category`*/;
1137
/*!50001 SET @saved_cs_client = @@character_set_client */;
1138
/*!50001 SET @saved_cs_results = @@character_set_results */;
1139
/*!50001 SET @saved_col_connection = @@collation_connection */;
1140
/*!50001 SET character_set_client = latin1 */;
1141
/*!50001 SET character_set_results = latin1 */;
1142
/*!50001 SET collation_connection = latin1_swedish_ci */;
1143
/*!50001 CREATE ALGORITHM=UNDEFINED */
1144
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1145
/*!50001 VIEW `sales_by_film_category` AS select `c`.`name` AS `category`,sum(`p`.`amount`) AS `total_sales` from (((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `film` `f` on((`i`.`film_id` = `f`.`film_id`))) join `film_category` `fc` on((`f`.`film_id` = `fc`.`film_id`))) join `category` `c` on((`fc`.`category_id` = `c`.`category_id`))) group by `c`.`name` order by sum(`p`.`amount`) desc */;
1146
/*!50001 SET character_set_client = @saved_cs_client */;
1147
/*!50001 SET character_set_results = @saved_cs_results */;
1148
/*!50001 SET collation_connection = @saved_col_connection */;
1151
-- Final view structure for view `sales_by_store`
1154
/*!50001 DROP TABLE IF EXISTS `sales_by_store`*/;
1155
/*!50001 DROP VIEW IF EXISTS `sales_by_store`*/;
1156
/*!50001 SET @saved_cs_client = @@character_set_client */;
1157
/*!50001 SET @saved_cs_results = @@character_set_results */;
1158
/*!50001 SET @saved_col_connection = @@collation_connection */;
1159
/*!50001 SET character_set_client = latin1 */;
1160
/*!50001 SET character_set_results = latin1 */;
1161
/*!50001 SET collation_connection = latin1_swedish_ci */;
1162
/*!50001 CREATE ALGORITHM=UNDEFINED */
1163
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1164
/*!50001 VIEW `sales_by_store` AS select concat(`c`.`city`,_utf8',',`cy`.`country`) AS `store`,concat(`m`.`first_name`,_utf8' ',`m`.`last_name`) AS `manager`,sum(`p`.`amount`) AS `total_sales` from (((((((`payment` `p` join `rental` `r` on((`p`.`rental_id` = `r`.`rental_id`))) join `inventory` `i` on((`r`.`inventory_id` = `i`.`inventory_id`))) join `store` `s` on((`i`.`store_id` = `s`.`store_id`))) join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` `c` on((`a`.`city_id` = `c`.`city_id`))) join `country` `cy` on((`c`.`country_id` = `cy`.`country_id`))) join `staff` `m` on((`s`.`manager_staff_id` = `m`.`staff_id`))) group by `s`.`store_id` order by `cy`.`country`,`c`.`city` */;
1165
/*!50001 SET character_set_client = @saved_cs_client */;
1166
/*!50001 SET character_set_results = @saved_cs_results */;
1167
/*!50001 SET collation_connection = @saved_col_connection */;
1170
-- Final view structure for view `staff_list`
1173
/*!50001 DROP TABLE IF EXISTS `staff_list`*/;
1174
/*!50001 DROP VIEW IF EXISTS `staff_list`*/;
1175
/*!50001 SET @saved_cs_client = @@character_set_client */;
1176
/*!50001 SET @saved_cs_results = @@character_set_results */;
1177
/*!50001 SET @saved_col_connection = @@collation_connection */;
1178
/*!50001 SET character_set_client = latin1 */;
1179
/*!50001 SET character_set_results = latin1 */;
1180
/*!50001 SET collation_connection = latin1_swedish_ci */;
1181
/*!50001 CREATE ALGORITHM=UNDEFINED */
1182
/*!50013 DEFINER=`msandbox`@`%` SQL SECURITY DEFINER */
1183
/*!50001 VIEW `staff_list` AS select `s`.`staff_id` AS `ID`,concat(`s`.`first_name`,_utf8' ',`s`.`last_name`) AS `name`,`a`.`address` AS `address`,`a`.`postal_code` AS `zip code`,`a`.`phone` AS `phone`,`city`.`city` AS `city`,`country`.`country` AS `country`,`s`.`store_id` AS `SID` from (((`staff` `s` join `address` `a` on((`s`.`address_id` = `a`.`address_id`))) join `city` on((`a`.`city_id` = `city`.`city_id`))) join `country` on((`city`.`country_id` = `country`.`country_id`))) */;
1184
/*!50001 SET character_set_client = @saved_cs_client */;
1185
/*!50001 SET character_set_results = @saved_cs_results */;
1186
/*!50001 SET collation_connection = @saved_col_connection */;
1189
-- Current Database: `mysql`
1193
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1195
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1196
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1197
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1198
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1199
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1200
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1201
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1203
-- Dump completed on 2011-05-21 6:58:44