· 9 years ago · Oct 30, 2016, 08:08 PM
1CREATE DATABASE IF NOT EXISTS `mydb` /*!40100 DEFAULT CHARACTER SET utf8 */;
2USE `mydb`;
3-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
4--
5-- Host: localhost Database: mydb
6-- ------------------------------------------------------
7-- Server version 5.7.16-log
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!40101 SET NAMES utf8 */;
13/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14/*!40103 SET TIME_ZONE='+00:00' */;
15/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20--
21-- Table structure for table `actor`
22--
23
24DROP TABLE IF EXISTS `actor`;
25/*!40101 SET @saved_cs_client = @@character_set_client */;
26/*!40101 SET character_set_client = utf8 */;
27CREATE TABLE `actor` (
28 `ActorID` int(11) NOT NULL AUTO_INCREMENT,
29 `ActorName` varchar(45) DEFAULT NULL,
30 PRIMARY KEY (`ActorID`)
31) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
32/*!40101 SET character_set_client = @saved_cs_client */;
33
34--
35-- Dumping data for table `actor`
36--
37
38LOCK TABLES `actor` WRITE;
39/*!40000 ALTER TABLE `actor` DISABLE KEYS */;
40INSERT INTO `actor` VALUES (1,'Tim Tobbins'),(2,'Morgan Freeman'),(5,'Marlon Brando'),(6,'Al Pacino'),(7,'James Caan'),(8,'Robert Duvall'),(9,'Diane Keaton'),(10,'Robert De Niro'),(11,'Christian Bale'),(12,'Heath Ledger'),(13,'Charlie Sheen'),(14,'Tom Bernger'),(15,'Albert Brooks'),(16,'Ellen DeGeneres');
41/*!40000 ALTER TABLE `actor` ENABLE KEYS */;
42UNLOCK TABLES;
43
44--
45-- Table structure for table `actormovie`
46--
47
48DROP TABLE IF EXISTS `actormovie`;
49/*!40101 SET @saved_cs_client = @@character_set_client */;
50/*!40101 SET character_set_client = utf8 */;
51CREATE TABLE `actormovie` (
52 `MovieID` int(11) NOT NULL,
53 `ActorID` int(11) NOT NULL,
54 `AwardsID` int(11) DEFAULT NULL,
55 PRIMARY KEY (`MovieID`,`ActorID`),
56 KEY `ActorID6_idx` (`ActorID`),
57 KEY `AwardID2_idx` (`AwardsID`),
58 CONSTRAINT `ActorID6` FOREIGN KEY (`ActorID`) REFERENCES `actor` (`ActorID`) ON DELETE CASCADE ON UPDATE CASCADE,
59 CONSTRAINT `AwardID2` FOREIGN KEY (`AwardsID`) REFERENCES `award` (`AwardID`) ON DELETE CASCADE ON UPDATE CASCADE,
60 CONSTRAINT `MovieID11` FOREIGN KEY (`MovieID`) REFERENCES `movie` (`MovieID`) ON DELETE CASCADE ON UPDATE CASCADE
61) ENGINE=InnoDB DEFAULT CHARSET=utf8;
62/*!40101 SET character_set_client = @saved_cs_client */;
63
64--
65-- Dumping data for table `actormovie`
66--
67
68LOCK TABLES `actormovie` WRITE;
69/*!40000 ALTER TABLE `actormovie` DISABLE KEYS */;
70INSERT INTO `actormovie` VALUES (1,1,NULL),(1,7,NULL),(3,9,NULL),(5,13,NULL),(6,15,NULL),(1,2,1),(2,5,2),(2,6,3),(2,8,4),(3,10,7),(3,6,8),(4,12,9),(4,11,10),(5,14,13),(6,16,14);
71/*!40000 ALTER TABLE `actormovie` ENABLE KEYS */;
72UNLOCK TABLES;
73
74--
75-- Table structure for table `award`
76--
77
78DROP TABLE IF EXISTS `award`;
79/*!40101 SET @saved_cs_client = @@character_set_client */;
80/*!40101 SET character_set_client = utf8 */;
81CREATE TABLE `award` (
82 `AwardID` int(11) NOT NULL AUTO_INCREMENT,
83 `Name` varchar(45) NOT NULL,
84 `Description` varchar(100) DEFAULT NULL,
85 PRIMARY KEY (`AwardID`)
86) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
87/*!40101 SET character_set_client = @saved_cs_client */;
88
89--
90-- Dumping data for table `award`
91--
92
93LOCK TABLES `award` WRITE;
94/*!40000 ALTER TABLE `award` DISABLE KEYS */;
95INSERT INTO `award` VALUES (1,'Golden Globe','Best Performance by an Actor in a Motion Picture - Drama'),(2,'Oscar','Best Actor in a Leading Role'),(3,'David di Donatello Award','Acting'),(4,'NewYork Film Critics Circle Award','Best Supporting Actor'),(5,'Awards Circuit Community Award','Best Adapted Screenplay'),(6,'Oscar','Best Writing, Screenplay Based on Material from Another Medium'),(7,'Oscar','Best Actor in a Supporting Role'),(8,'BAFTA','Best Actor'),(9,'Oscar','Best Performance by an Actor in a Supporting Role'),(10,'People\'s Choice Awards','Favorite Superhero'),(11,'Oscar','Best Director'),(12,'Saturn Award','Best Director'),(13,'Golden Globe','Best Performance by an Actor in a Supporting Role in a Motion Picture'),(14,'Saturn Award','Best Supporting Actress'),(15,'Oscar','Best Animated Feature'),(16,'BAFTA Children\'s Award','Best Feature Film'),(17,'Golden Globe','Best Motion Picture - Comedy or Musical'),(18,'Golden Globe','Best Motion Picture - Drama'),(19,'Saturn Award','Best Action/Adventure/Thriller Film'),(20,'Sierra Award','Best DVD'),(21,'OFTA Film Hall of Fame','Motion Picture');
96/*!40000 ALTER TABLE `award` ENABLE KEYS */;
97UNLOCK TABLES;
98
99--
100-- Table structure for table `catalogitem`
101--
102
103DROP TABLE IF EXISTS `catalogitem`;
104/*!40101 SET @saved_cs_client = @@character_set_client */;
105/*!40101 SET character_set_client = utf8 */;
106CREATE TABLE `catalogitem` (
107 `CataglogItemID` int(11) NOT NULL AUTO_INCREMENT,
108 `DistID` int(11) NOT NULL,
109 `MovieID` int(11) NOT NULL,
110 `FormatID` varchar(3) NOT NULL,
111 `DistCatalogItemID` varchar(100) DEFAULT NULL,
112 `DistMovieID` varchar(100) DEFAULT NULL,
113 `Price` decimal(10,2) NOT NULL,
114 PRIMARY KEY (`CataglogItemID`),
115 KEY `DistID_idx` (`DistID`),
116 KEY `MovieID232_idx` (`MovieID`),
117 KEY `FormatID22_idx` (`FormatID`),
118 CONSTRAINT `DistID` FOREIGN KEY (`DistID`) REFERENCES `distributor` (`DistID`) ON DELETE CASCADE ON UPDATE CASCADE,
119 CONSTRAINT `FormatID22` FOREIGN KEY (`FormatID`) REFERENCES `format` (`FormatID`) ON DELETE CASCADE ON UPDATE CASCADE,
120 CONSTRAINT `MovieID232` FOREIGN KEY (`MovieID`) REFERENCES `movie` (`MovieID`) ON DELETE CASCADE ON UPDATE CASCADE
121) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
122/*!40101 SET character_set_client = @saved_cs_client */;
123
124--
125-- Dumping data for table `catalogitem`
126--
127
128LOCK TABLES `catalogitem` WRITE;
129/*!40000 ALTER TABLE `catalogitem` DISABLE KEYS */;
130INSERT INTO `catalogitem` VALUES (7,1,1,'DVD','6541969519619','646',11.24),(8,2,3,'VHS','61614951619','654',8.75),(9,5,4,'VHS','61561991919491919191','6565',6.95),(10,3,6,'DVD','656191919191944544','4475',14.75),(11,3,2,'VHS','432154161891','44574',12.38),(12,4,1,'VHS','987319652065115','421068',14.23);
131/*!40000 ALTER TABLE `catalogitem` ENABLE KEYS */;
132UNLOCK TABLES;
133
134--
135-- Table structure for table `charges`
136--
137
138DROP TABLE IF EXISTS `charges`;
139/*!40101 SET @saved_cs_client = @@character_set_client */;
140/*!40101 SET character_set_client = utf8 */;
141CREATE TABLE `charges` (
142 `ChargesID` int(11) NOT NULL AUTO_INCREMENT,
143 `RentalsID` int(11) NOT NULL,
144 `Description` varchar(2000) NOT NULL,
145 `Amount` decimal(10,2) NOT NULL,
146 PRIMARY KEY (`ChargesID`),
147 KEY `RentalsID2323_idx` (`RentalsID`),
148 CONSTRAINT `RentalsID2323` FOREIGN KEY (`RentalsID`) REFERENCES `rentals` (`RentalsID`) ON DELETE NO ACTION ON UPDATE NO ACTION
149) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
150/*!40101 SET character_set_client = @saved_cs_client */;
151
152--
153-- Dumping data for table `charges`
154--
155
156LOCK TABLES `charges` WRITE;
157/*!40000 ALTER TABLE `charges` DISABLE KEYS */;
158INSERT INTO `charges` VALUES (1,11,'The Shawshank Redemtion DVD Returned Late 2 day',7.68),(2,22,'2 VHS: The Shawshank Redemtion, God Father, returned on time. 1 Rewind Fee',6.94),(3,33,'1 DVD: Patoon. Returned on time',5.00),(4,44,'1 DVD The Dark Knight Returns. Returned on time',6.00),(5,55,'1 VHS Finding Nemo returned late 2 days',5.24),(6,66,'1 DVD The Shawshank Remption, returned on time.',6.00),(7,77,'1 DVD of The God Father II',5.50);
159/*!40000 ALTER TABLE `charges` ENABLE KEYS */;
160UNLOCK TABLES;
161
162--
163-- Table structure for table `customer`
164--
165
166DROP TABLE IF EXISTS `customer`;
167/*!40101 SET @saved_cs_client = @@character_set_client */;
168/*!40101 SET character_set_client = utf8 */;
169CREATE TABLE `customer` (
170 `CustomerID` int(11) NOT NULL AUTO_INCREMENT,
171 `Name` varchar(45) NOT NULL,
172 `Address` varchar(45) NOT NULL,
173 `City` varchar(45) NOT NULL,
174 `State` varchar(2) NOT NULL,
175 `ZipCode` int(5) NOT NULL,
176 `PhoneNumber` varchar(12) DEFAULT NULL,
177 `Email` varchar(45) DEFAULT NULL,
178 `IsBlocked` tinyint(1) NOT NULL,
179 `BlockedReason` varchar(45) DEFAULT NULL,
180 PRIMARY KEY (`CustomerID`)
181) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
182/*!40101 SET character_set_client = @saved_cs_client */;
183
184--
185-- Dumping data for table `customer`
186--
187
188LOCK TABLES `customer` WRITE;
189/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
190INSERT INTO `customer` VALUES (2,'Tracer McCree','22 Google Cr.','Solon','OH',79465,'123-456-7890','Pass@gmail.com',0,NULL),(3,'Jon Markus','33 Visio Tr.','Columbus','OH',71935,'024-476-7976','Me@gmail.com',0,NULL),(4,'Chris Hampton','44 Chrome Ave.','Cleveland','OH',52897,'479-554-6699','With@gmail.com',0,NULL),(5,'Krystal Mars','55 Notepad St.','Bainbridge','OH',21357,'440-587-0658','ABee@gmail.com',0,NULL);
191/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
192UNLOCK TABLES;
193
194--
195-- Table structure for table `director`
196--
197
198DROP TABLE IF EXISTS `director`;
199/*!40101 SET @saved_cs_client = @@character_set_client */;
200/*!40101 SET character_set_client = utf8 */;
201CREATE TABLE `director` (
202 `DirectorID` int(11) NOT NULL AUTO_INCREMENT,
203 `Name` varchar(45) NOT NULL,
204 PRIMARY KEY (`DirectorID`)
205) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
206/*!40101 SET character_set_client = @saved_cs_client */;
207
208--
209-- Dumping data for table `director`
210--
211
212LOCK TABLES `director` WRITE;
213/*!40000 ALTER TABLE `director` DISABLE KEYS */;
214INSERT INTO `director` VALUES (1,'Frank Darabont'),(2,'Francis Ford Coppola'),(3,'Christopher Nolan'),(4,'Oliver Stone'),(7,'Andrew Saton'),(8,'Lee Unkrich');
215/*!40000 ALTER TABLE `director` ENABLE KEYS */;
216UNLOCK TABLES;
217
218--
219-- Table structure for table `directormovie`
220--
221
222DROP TABLE IF EXISTS `directormovie`;
223/*!40101 SET @saved_cs_client = @@character_set_client */;
224/*!40101 SET character_set_client = utf8 */;
225CREATE TABLE `directormovie` (
226 `DirectorID` int(11) NOT NULL,
227 `MovieID` int(11) NOT NULL,
228 `AwardID` int(11) DEFAULT NULL,
229 PRIMARY KEY (`DirectorID`,`MovieID`),
230 KEY `MovieID12_idx` (`MovieID`),
231 KEY `AwardID12_idx` (`AwardID`),
232 CONSTRAINT `AwardID12` FOREIGN KEY (`AwardID`) REFERENCES `award` (`AwardID`) ON DELETE CASCADE ON UPDATE CASCADE,
233 CONSTRAINT `DirectorID12` FOREIGN KEY (`DirectorID`) REFERENCES `director` (`DirectorID`) ON DELETE CASCADE ON UPDATE CASCADE,
234 CONSTRAINT `MovieID12` FOREIGN KEY (`MovieID`) REFERENCES `movie` (`MovieID`) ON DELETE CASCADE ON UPDATE CASCADE
235) ENGINE=InnoDB DEFAULT CHARSET=utf8;
236/*!40101 SET character_set_client = @saved_cs_client */;
237
238--
239-- Dumping data for table `directormovie`
240--
241
242LOCK TABLES `directormovie` WRITE;
243/*!40000 ALTER TABLE `directormovie` DISABLE KEYS */;
244INSERT INTO `directormovie` VALUES (1,1,5),(2,2,6),(2,3,11),(4,5,11),(3,4,12),(7,6,15),(8,6,16);
245/*!40000 ALTER TABLE `directormovie` ENABLE KEYS */;
246UNLOCK TABLES;
247
248--
249-- Table structure for table `distributor`
250--
251
252DROP TABLE IF EXISTS `distributor`;
253/*!40101 SET @saved_cs_client = @@character_set_client */;
254/*!40101 SET character_set_client = utf8 */;
255CREATE TABLE `distributor` (
256 `DistID` int(11) NOT NULL AUTO_INCREMENT,
257 `Name` varchar(45) NOT NULL,
258 `Address` varchar(45) DEFAULT NULL,
259 `PhoneNumber` varchar(12) DEFAULT NULL,
260 PRIMARY KEY (`DistID`),
261 UNIQUE KEY `PhoneNumber_UNIQUE` (`PhoneNumber`)
262) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
263/*!40101 SET character_set_client = @saved_cs_client */;
264
265--
266-- Dumping data for table `distributor`
267--
268
269LOCK TABLES `distributor` WRITE;
270/*!40000 ALTER TABLE `distributor` DISABLE KEYS */;
271INSERT INTO `distributor` VALUES (1,'Movies R US','33 Creative St. Movie Town, OH 79856','555-212-1111'),(2,'Billy-Bob Movies','11 Holloween Cr. Cleveland, OH 46577','555-322-1256'),(3,'Seller Man','22 Washington St. Ada, OH 46589','456-123-8976'),(4,'Movie Sales','55 Main St. Columbus, OH 78945','741-826-5798'),(5,'The Movie Man','77 Hopefule Ave. Lucky Town, OH 47954','684-975-1268'),(6,'Buy-N-Sell Movies','99 Wonderful St. Pleasent, OH 65389','159-357-7913');
272/*!40000 ALTER TABLE `distributor` ENABLE KEYS */;
273UNLOCK TABLES;
274
275--
276-- Table structure for table `format`
277--
278
279DROP TABLE IF EXISTS `format`;
280/*!40101 SET @saved_cs_client = @@character_set_client */;
281/*!40101 SET character_set_client = utf8 */;
282CREATE TABLE `format` (
283 `FormatID` varchar(5) NOT NULL,
284 `FormatName` varchar(44) NOT NULL,
285 PRIMARY KEY (`FormatID`)
286) ENGINE=InnoDB DEFAULT CHARSET=utf8;
287/*!40101 SET character_set_client = @saved_cs_client */;
288
289--
290-- Dumping data for table `format`
291--
292
293LOCK TABLES `format` WRITE;
294/*!40000 ALTER TABLE `format` DISABLE KEYS */;
295INSERT INTO `format` VALUES ('DVD','Digital Versatile Disc'),('VHS','Vertical Helical Scan');
296/*!40000 ALTER TABLE `format` ENABLE KEYS */;
297UNLOCK TABLES;
298
299--
300-- Table structure for table `movie`
301--
302
303DROP TABLE IF EXISTS `movie`;
304/*!40101 SET @saved_cs_client = @@character_set_client */;
305/*!40101 SET character_set_client = utf8 */;
306CREATE TABLE `movie` (
307 `MovieID` int(11) NOT NULL AUTO_INCREMENT,
308 `Name` varchar(45) NOT NULL,
309 `AgeRating` varchar(10) DEFAULT NULL,
310 `Genre` varchar(45) DEFAULT NULL,
311 `Length` int(3) NOT NULL,
312 `Rating` int(1) DEFAULT NULL,
313 `YearReleased` int(4) DEFAULT NULL,
314 PRIMARY KEY (`MovieID`)
315) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
316/*!40101 SET character_set_client = @saved_cs_client */;
317
318--
319-- Dumping data for table `movie`
320--
321
322LOCK TABLES `movie` WRITE;
323/*!40000 ALTER TABLE `movie` DISABLE KEYS */;
324INSERT INTO `movie` VALUES (1,'The ShawShank Redemtion','R','Drama',144,9,1994),(2,'The Godfather','R','Crime',175,9,1972),(3,'The Godfather: Part II','R','Crime',202,9,1974),(4,'The Dark Knight','PG-13','Action',152,9,2008),(5,'Platoon','R','War',120,8,1986),(6,'Finding Nemo','G','Animation',80,8,2003);
325/*!40000 ALTER TABLE `movie` ENABLE KEYS */;
326UNLOCK TABLES;
327
328--
329-- Table structure for table `movieaward`
330--
331
332DROP TABLE IF EXISTS `movieaward`;
333/*!40101 SET @saved_cs_client = @@character_set_client */;
334/*!40101 SET character_set_client = utf8 */;
335CREATE TABLE `movieaward` (
336 `MovieAwardID` int(11) NOT NULL AUTO_INCREMENT,
337 `MovieID` int(11) DEFAULT NULL,
338 `AwardID` int(11) DEFAULT NULL,
339 PRIMARY KEY (`MovieAwardID`),
340 KEY `MovieID222_idx` (`MovieID`),
341 KEY `AwardID222_idx` (`AwardID`),
342 CONSTRAINT `AwardID222` FOREIGN KEY (`AwardID`) REFERENCES `award` (`AwardID`) ON DELETE CASCADE ON UPDATE CASCADE,
343 CONSTRAINT `MovieID222` FOREIGN KEY (`MovieID`) REFERENCES `movie` (`MovieID`) ON DELETE CASCADE ON UPDATE CASCADE
344) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
345/*!40101 SET character_set_client = @saved_cs_client */;
346
347--
348-- Dumping data for table `movieaward`
349--
350
351LOCK TABLES `movieaward` WRITE;
352/*!40000 ALTER TABLE `movieaward` DISABLE KEYS */;
353INSERT INTO `movieaward` VALUES (1,6,17),(2,5,18),(3,4,19),(4,3,18),(5,2,20),(6,1,21);
354/*!40000 ALTER TABLE `movieaward` ENABLE KEYS */;
355UNLOCK TABLES;
356
357--
358-- Table structure for table `moviecopy`
359--
360
361DROP TABLE IF EXISTS `moviecopy`;
362/*!40101 SET @saved_cs_client = @@character_set_client */;
363/*!40101 SET character_set_client = utf8 */;
364CREATE TABLE `moviecopy` (
365 `CopyID` int(11) NOT NULL AUTO_INCREMENT,
366 `MovieID` int(11) NOT NULL,
367 `FormatID` varchar(3) NOT NULL,
368 `DistributorSerial#` varchar(100) DEFAULT NULL,
369 PRIMARY KEY (`CopyID`),
370 KEY `MovieID4_idx` (`MovieID`),
371 KEY `FormatNameID1_idx` (`FormatID`),
372 CONSTRAINT `FormatID55` FOREIGN KEY (`FormatID`) REFERENCES `format` (`FormatID`) ON DELETE CASCADE ON UPDATE CASCADE,
373 CONSTRAINT `MovieID9` FOREIGN KEY (`MovieID`) REFERENCES `movie` (`MovieID`) ON DELETE CASCADE ON UPDATE CASCADE
374) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
375/*!40101 SET character_set_client = @saved_cs_client */;
376
377--
378-- Dumping data for table `moviecopy`
379--
380
381LOCK TABLES `moviecopy` WRITE;
382/*!40000 ALTER TABLE `moviecopy` DISABLE KEYS */;
383INSERT INTO `moviecopy` VALUES (1,1,'DVD','651619891213'),(2,1,'VHS','6516162139'),(3,2,'VHS','45965131'),(4,5,'DVD','61621654621'),(5,4,'DVD','651491198495'),(6,6,'VHS','61958496591'),(7,1,'DVD','65161261969'),(8,3,'DVD','61619564575');
384/*!40000 ALTER TABLE `moviecopy` ENABLE KEYS */;
385UNLOCK TABLES;
386
387--
388-- Table structure for table `rentallineitems`
389--
390
391DROP TABLE IF EXISTS `rentallineitems`;
392/*!40101 SET @saved_cs_client = @@character_set_client */;
393/*!40101 SET character_set_client = utf8 */;
394CREATE TABLE `rentallineitems` (
395 `RentalLineItemsID` int(11) NOT NULL AUTO_INCREMENT,
396 `CopyID` int(11) NOT NULL,
397 `RentalsID` int(11) NOT NULL,
398 `RentDate` date NOT NULL,
399 `ReturnDate` date NOT NULL,
400 PRIMARY KEY (`RentalLineItemsID`),
401 KEY `CopyID1212_idx` (`CopyID`),
402 KEY `RentalIDsdsd_idx` (`RentalsID`),
403 CONSTRAINT `CopyID11112` FOREIGN KEY (`CopyID`) REFERENCES `moviecopy` (`CopyID`) ON DELETE CASCADE ON UPDATE CASCADE,
404 CONSTRAINT `RentalIDsdsd` FOREIGN KEY (`RentalsID`) REFERENCES `rentals` (`RentalsID`) ON DELETE CASCADE ON UPDATE CASCADE
405) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=big5;
406/*!40101 SET character_set_client = @saved_cs_client */;
407
408--
409-- Dumping data for table `rentallineitems`
410--
411
412LOCK TABLES `rentallineitems` WRITE;
413/*!40000 ALTER TABLE `rentallineitems` DISABLE KEYS */;
414INSERT INTO `rentallineitems` VALUES (15,1,11,'2016-09-01','2016-09-07'),(16,2,22,'2016-09-10','2016-09-16'),(17,3,22,'2016-09-10','2016-09-16'),(18,4,33,'2016-09-10','2016-09-16'),(19,5,44,'2016-10-10','2016-10-16'),(20,6,55,'2016-10-10','2016-10-16'),(21,7,66,'2016-10-25','2016-11-01'),(22,8,77,'2016-09-20','2016-09-26');
415/*!40000 ALTER TABLE `rentallineitems` ENABLE KEYS */;
416UNLOCK TABLES;
417
418--
419-- Table structure for table `rentals`
420--
421
422DROP TABLE IF EXISTS `rentals`;
423/*!40101 SET @saved_cs_client = @@character_set_client */;
424/*!40101 SET character_set_client = utf8 */;
425CREATE TABLE `rentals` (
426 `RentalsID` int(11) NOT NULL AUTO_INCREMENT,
427 `CustomerID` int(11) NOT NULL,
428 PRIMARY KEY (`RentalsID`),
429 KEY `CustomerID_idx` (`CustomerID`),
430 CONSTRAINT `CustomerID` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CustomerID`) ON DELETE CASCADE ON UPDATE CASCADE
431) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
432/*!40101 SET character_set_client = @saved_cs_client */;
433
434--
435-- Dumping data for table `rentals`
436--
437
438LOCK TABLES `rentals` WRITE;
439/*!40000 ALTER TABLE `rentals` DISABLE KEYS */;
440INSERT INTO `rentals` VALUES (11,2),(77,2),(33,3),(55,3),(44,4),(66,4),(22,5),(88,5);
441/*!40000 ALTER TABLE `rentals` ENABLE KEYS */;
442UNLOCK TABLES;
443/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
444
445/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
446/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
447/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
448/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
449/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
450/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
451/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
452
453-- Dump completed on 2016-10-30 16:02:32