· 8 years ago · Aug 02, 2018, 11:14 AM
1-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
2--
3-- Host: localhost Database: bookstore
4-- ------------------------------------------------------
5-- Server version 5.7.21-log
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!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 */;
17
18--
19-- Table structure for table `book`
20--
21
22DROP TABLE IF EXISTS `book`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `book` (
26 `authorName` varchar(20) NOT NULL,
27 `bookName` varchar(20) NOT NULL,
28 `bookPrice` float DEFAULT NULL,
29 `amount` int(10) unsigned DEFAULT NULL,
30 PRIMARY KEY (`bookName`)
31) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32/*!40101 SET character_set_client = @saved_cs_client */;
33
34--
35-- Dumping data for table `book`
36--
37
38LOCK TABLES `book` WRITE;
39/*!40000 ALTER TABLE `book` DISABLE KEYS */;
40INSERT INTO `book` VALUES ('Hilary Thomas','Bevis Robbins',68,58),('Zahir Marquez','Duncan Valencia',98,92),('Jeremy Hodges','Harriet Cherry',76,75),('Imani Wolf','Katelyn Doyle',50,0),('Emily Lott','Maggy Willis',77,62),('Lydia Montoya','Odysseus Mcbride',56,98),('Merrill Chang','Randall Wagner',84,14),('Kyle Wynn','Sybil Sanchez',118,69),('Lavinia Mcintyre','Taylor Dale',53,19),('Tallulah Fisher','Yasir Huber',108,58);
41/*!40000 ALTER TABLE `book` ENABLE KEYS */;
42UNLOCK TABLES;
43
44--
45-- Table structure for table `customer`
46--
47
48DROP TABLE IF EXISTS `customer`;
49/*!40101 SET @saved_cs_client = @@character_set_client */;
50/*!40101 SET character_set_client = utf8 */;
51CREATE TABLE `customer` (
52 `customerName` varchar(20) NOT NULL,
53 `customerNumber` int(10) unsigned NOT NULL AUTO_INCREMENT,
54 `cellphone` int(10) unsigned DEFAULT NULL,
55 `totalPurchase` float DEFAULT NULL,
56 PRIMARY KEY (`customerNumber`)
57) ENGINE=InnoDB AUTO_INCREMENT=7704 DEFAULT CHARSET=utf8;
58/*!40101 SET character_set_client = @saved_cs_client */;
59
60--
61-- Dumping data for table `customer`
62--
63
64LOCK TABLES `customer` WRITE;
65/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
66INSERT INTO `customer` VALUES ('Seth Lancaster',2717,545267404,1802),('Hamilton Hill',4436,586946649,416),('Norman Vargas',5374,516682286,1899),('Kasper Tate',6095,546455053,899),('Cyrus Hopper',6201,534281425,1472),('Mark Hardin',6395,514036274,988),('Mark Glenn',6733,544306940,1802),('Kamal Chavez',6767,545877304,858),('Candice Schwartz',7539,538571022,854),('Bo Acevedo',7703,567520917,140);
67/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
68UNLOCK TABLES;
69
70--
71-- Table structure for table `globaldiscount`
72--
73
74DROP TABLE IF EXISTS `globaldiscount`;
75/*!40101 SET @saved_cs_client = @@character_set_client */;
76/*!40101 SET character_set_client = utf8 */;
77CREATE TABLE `globaldiscount` (
78 `startDate` date DEFAULT NULL,
79 `endDate` date DEFAULT NULL,
80 `discountPrice` int(10) unsigned DEFAULT NULL,
81 `discountNumber` int(10) unsigned NOT NULL,
82 `discountName` varchar(20) NOT NULL,
83 `bookName` varchar(20) NOT NULL,
84 PRIMARY KEY (`discountNumber`)
85) ENGINE=InnoDB DEFAULT CHARSET=utf8;
86/*!40101 SET character_set_client = @saved_cs_client */;
87
88--
89-- Dumping data for table `globaldiscount`
90--
91
92LOCK TABLES `globaldiscount` WRITE;
93/*!40000 ALTER TABLE `globaldiscount` DISABLE KEYS */;
94INSERT INTO `globaldiscount` VALUES ('2018-08-01','2018-08-30',30,2,'back to school','Bevis Robbins'),('2017-09-02','2017-09-12',20,4,'rosh hashana','Duncan Valencia'),('2018-01-04','2018-02-05',30,7,'month book','Harriet Cherry'),('2017-02-17','2017-03-22',50,8,'1+1','Katelyn Doyle'),('2018-10-27','2018-11-16',10,10,'special sale','Maggy Willis'),('2017-10-16','2017-10-23',50,11,'week book','Odysseus Mcbride'),('2018-06-01','2018-06-30',30,13,'summer sale','Randall Wagner'),('2017-04-03','2017-04-17',20,15,'passover','Sybil Sanchez'),('2017-01-12','2017-02-11',40,16,'Clearance sale','Taylor Dale'),('2017-12-15','2018-01-01',20,17,'new years','Yasir Huber');
95/*!40000 ALTER TABLE `globaldiscount` ENABLE KEYS */;
96UNLOCK TABLES;
97
98--
99-- Table structure for table `make_an`
100--
101
102DROP TABLE IF EXISTS `make_an`;
103/*!40101 SET @saved_cs_client = @@character_set_client */;
104/*!40101 SET character_set_client = utf8 */;
105CREATE TABLE `make_an` (
106 `totalPrice` float DEFAULT NULL,
107 `transNumber` int(10) unsigned NOT NULL AUTO_INCREMENT,
108 `customerNumber` int(10) unsigned DEFAULT NULL,
109 `sellerNumber` int(10) unsigned DEFAULT NULL,
110 `bookName` varchar(20) NOT NULL,
111 PRIMARY KEY (`transNumber`),
112 KEY `customerNumber` (`customerNumber`),
113 KEY `sellerNumber` (`sellerNumber`),
114 KEY `bookName` (`bookName`),
115 CONSTRAINT `make_an_ibfk_1` FOREIGN KEY (`transNumber`) REFERENCES `transaction` (`transNumber`),
116 CONSTRAINT `make_an_ibfk_2` FOREIGN KEY (`customerNumber`) REFERENCES `customer` (`customerNumber`),
117 CONSTRAINT `make_an_ibfk_3` FOREIGN KEY (`sellerNumber`) REFERENCES `seller` (`sellerNumber`),
118 CONSTRAINT `make_an_ibfk_4` FOREIGN KEY (`bookName`) REFERENCES `book` (`bookName`)
119) ENGINE=InnoDB AUTO_INCREMENT=9735 DEFAULT CHARSET=utf8;
120/*!40101 SET character_set_client = @saved_cs_client */;
121
122--
123-- Dumping data for table `make_an`
124--
125
126LOCK TABLES `make_an` WRITE;
127/*!40000 ALTER TABLE `make_an` DISABLE KEYS */;
128INSERT INTO `make_an` VALUES (120,2848,2717,134,'Bevis Robbins'),(375,3742,4436,169,'Duncan Valencia'),(106,4018,5374,173,'Harriet Cherry'),(186,4823,6095,203,'Katelyn Doyle'),(77,5456,6201,409,'Maggy Willis'),(246,7240,6395,512,'Yasir Huber'),(53,8439,6733,553,'Taylor Dale'),(107,8519,7539,583,'Randall Wagner'),(77,9281,7703,689,'Maggy Willis'),(202,9734,2717,850,'Sybil Sanchez');
129/*!40000 ALTER TABLE `make_an` ENABLE KEYS */;
130UNLOCK TABLES;
131
132--
133-- Table structure for table `orderbook`
134--
135
136DROP TABLE IF EXISTS `orderbook`;
137/*!40101 SET @saved_cs_client = @@character_set_client */;
138/*!40101 SET character_set_client = utf8 */;
139CREATE TABLE `orderbook` (
140 `dateOrder` date DEFAULT NULL,
141 `orderNumber` int(10) unsigned NOT NULL,
142 `statusOrder` int(10) unsigned DEFAULT NULL,
143 PRIMARY KEY (`orderNumber`)
144) ENGINE=InnoDB DEFAULT CHARSET=utf8;
145/*!40101 SET character_set_client = @saved_cs_client */;
146
147--
148-- Dumping data for table `orderbook`
149--
150
151LOCK TABLES `orderbook` WRITE;
152/*!40000 ALTER TABLE `orderbook` DISABLE KEYS */;
153INSERT INTO `orderbook` VALUES ('2018-05-30',3154,5),('2018-01-01',3254,4),('2018-05-08',4435,5),('2018-05-15',5508,4),('2018-07-11',5916,3),('2018-02-13',6705,3),('2018-04-18',6807,1),('2018-03-12',7004,3),('2018-02-01',8962,3),('2017-09-21',9705,3);
154/*!40000 ALTER TABLE `orderbook` ENABLE KEYS */;
155UNLOCK TABLES;
156
157--
158-- Table structure for table `personaldiscount`
159--
160
161DROP TABLE IF EXISTS `personaldiscount`;
162/*!40101 SET @saved_cs_client = @@character_set_client */;
163/*!40101 SET character_set_client = utf8 */;
164CREATE TABLE `personaldiscount` (
165 `startDate` date DEFAULT NULL,
166 `endDate` date DEFAULT NULL,
167 `discountPrice` float DEFAULT NULL,
168 `customerNumber` int(10) unsigned NOT NULL,
169 PRIMARY KEY (`customerNumber`),
170 CONSTRAINT `personaldiscount_ibfk_1` FOREIGN KEY (`customerNumber`) REFERENCES `customer` (`customerNumber`)
171) ENGINE=InnoDB DEFAULT CHARSET=utf8;
172/*!40101 SET character_set_client = @saved_cs_client */;
173
174--
175-- Dumping data for table `personaldiscount`
176--
177
178LOCK TABLES `personaldiscount` WRITE;
179/*!40000 ALTER TABLE `personaldiscount` DISABLE KEYS */;
180INSERT INTO `personaldiscount` VALUES ('2018-01-01','2018-12-31',10,2717),('2018-01-01','2018-12-31',10,4436),('2018-01-01','2018-12-31',10,5374),('2018-01-01','2018-12-31',10,6095),('2018-01-01','2018-12-31',10,6201),('2018-01-01','2018-12-31',10,6395),('2018-01-01','2018-12-31',10,6733),('2018-01-01','2018-12-31',10,6767),('2018-01-01','2018-12-31',10,7539),('2018-01-01','2018-12-31',10,7703);
181/*!40000 ALTER TABLE `personaldiscount` ENABLE KEYS */;
182UNLOCK TABLES;
183
184--
185-- Table structure for table `place_an`
186--
187
188DROP TABLE IF EXISTS `place_an`;
189/*!40101 SET @saved_cs_client = @@character_set_client */;
190/*!40101 SET character_set_client = utf8 */;
191CREATE TABLE `place_an` (
192 `orderNumber` int(10) unsigned NOT NULL,
193 `customerNumber` int(10) unsigned DEFAULT NULL,
194 `bookName` varchar(20) NOT NULL,
195 PRIMARY KEY (`orderNumber`),
196 KEY `customerNumber` (`customerNumber`),
197 KEY `bookName` (`bookName`),
198 CONSTRAINT `place_an_ibfk_1` FOREIGN KEY (`orderNumber`) REFERENCES `orderbook` (`orderNumber`),
199 CONSTRAINT `place_an_ibfk_2` FOREIGN KEY (`customerNumber`) REFERENCES `customer` (`customerNumber`),
200 CONSTRAINT `place_an_ibfk_3` FOREIGN KEY (`bookName`) REFERENCES `book` (`bookName`)
201) ENGINE=InnoDB DEFAULT CHARSET=utf8;
202/*!40101 SET character_set_client = @saved_cs_client */;
203
204--
205-- Dumping data for table `place_an`
206--
207
208LOCK TABLES `place_an` WRITE;
209/*!40000 ALTER TABLE `place_an` DISABLE KEYS */;
210INSERT INTO `place_an` VALUES (3154,2717,'Bevis Robbins'),(3254,4436,'Duncan Valencia'),(4435,5374,'Harriet Cherry'),(5508,6095,'Katelyn Doyle'),(5916,6201,'Odysseus Mcbride'),(6705,6395,'Yasir Huber'),(6807,6733,'Taylor Dale'),(7004,7539,'Randall Wagner'),(8962,7703,'Maggy Willis'),(9705,6767,'Sybil Sanchez');
211/*!40000 ALTER TABLE `place_an` ENABLE KEYS */;
212UNLOCK TABLES;
213
214--
215-- Table structure for table `seller`
216--
217
218DROP TABLE IF EXISTS `seller`;
219/*!40101 SET @saved_cs_client = @@character_set_client */;
220/*!40101 SET character_set_client = utf8 */;
221CREATE TABLE `seller` (
222 `sellerNumber` int(10) unsigned NOT NULL,
223 `sellerName` varchar(20) NOT NULL,
224 PRIMARY KEY (`sellerNumber`)
225) ENGINE=InnoDB DEFAULT CHARSET=utf8;
226/*!40101 SET character_set_client = @saved_cs_client */;
227
228--
229-- Dumping data for table `seller`
230--
231
232LOCK TABLES `seller` WRITE;
233/*!40000 ALTER TABLE `seller` DISABLE KEYS */;
234INSERT INTO `seller` VALUES (134,'Cain Smith'),(169,'Byron Oneal'),(173,'Orlando Taylor'),(203,'Samuel Dyer'),(409,'Cain Nunez'),(512,'Bruce Mcintyre'),(553,'Maile Frank'),(583,'Perry Peterson'),(689,'Chaney Giles'),(850,'Patience Dominguez');
235/*!40000 ALTER TABLE `seller` ENABLE KEYS */;
236UNLOCK TABLES;
237
238--
239-- Table structure for table `supplier`
240--
241
242DROP TABLE IF EXISTS `supplier`;
243/*!40101 SET @saved_cs_client = @@character_set_client */;
244/*!40101 SET character_set_client = utf8 */;
245CREATE TABLE `supplier` (
246 `supplierName` varchar(20) NOT NULL,
247 `supplierNumber` int(10) unsigned NOT NULL,
248 PRIMARY KEY (`supplierNumber`)
249) ENGINE=InnoDB DEFAULT CHARSET=utf8;
250/*!40101 SET character_set_client = @saved_cs_client */;
251
252--
253-- Dumping data for table `supplier`
254--
255
256LOCK TABLES `supplier` WRITE;
257/*!40000 ALTER TABLE `supplier` DISABLE KEYS */;
258INSERT INTO `supplier` VALUES ('Non Inc.',100),('Odio Nam Industries',101),('Posuere Vulputate',102),('Sit Amet Inc.',103),('Nunc Inc.',104),('Vitae Associates',106),('Etiam Industries',107),('Varius Et Company',108),('Vel Company',109),('Ac Vel Corporation',110);
259/*!40000 ALTER TABLE `supplier` ENABLE KEYS */;
260UNLOCK TABLES;
261
262--
263-- Table structure for table `supply`
264--
265
266DROP TABLE IF EXISTS `supply`;
267/*!40101 SET @saved_cs_client = @@character_set_client */;
268/*!40101 SET character_set_client = utf8 */;
269CREATE TABLE `supply` (
270 `supplierPrice` int(10) unsigned DEFAULT NULL,
271 `supplierNumber` int(10) unsigned DEFAULT NULL,
272 `bookName` varchar(20) NOT NULL,
273 PRIMARY KEY (`bookName`),
274 KEY `supplierNumber` (`supplierNumber`),
275 CONSTRAINT `supply_ibfk_1` FOREIGN KEY (`supplierNumber`) REFERENCES `supplier` (`supplierNumber`),
276 CONSTRAINT `supply_ibfk_2` FOREIGN KEY (`bookName`) REFERENCES `book` (`bookName`)
277) ENGINE=InnoDB DEFAULT CHARSET=utf8;
278/*!40101 SET character_set_client = @saved_cs_client */;
279
280--
281-- Dumping data for table `supply`
282--
283
284LOCK TABLES `supply` WRITE;
285/*!40000 ALTER TABLE `supply` DISABLE KEYS */;
286INSERT INTO `supply` VALUES (38,102,'Bevis Robbins'),(68,109,'Duncan Valencia'),(46,108,'Harriet Cherry'),(20,100,'Katelyn Doyle'),(47,106,'Maggy Willis'),(26,100,'Odysseus Mcbride'),(44,107,'Randall Wagner'),(88,110,'Sybil Sanchez'),(23,104,'Taylor Dale'),(78,103,'Yasir Huber');
287/*!40000 ALTER TABLE `supply` ENABLE KEYS */;
288UNLOCK TABLES;
289
290--
291-- Table structure for table `transaction`
292--
293
294DROP TABLE IF EXISTS `transaction`;
295/*!40101 SET @saved_cs_client = @@character_set_client */;
296/*!40101 SET character_set_client = utf8 */;
297CREATE TABLE `transaction` (
298 `transNumber` int(10) unsigned NOT NULL AUTO_INCREMENT,
299 `transDate` date DEFAULT NULL,
300 `totalPrice` float DEFAULT NULL,
301 PRIMARY KEY (`transNumber`)
302) ENGINE=InnoDB AUTO_INCREMENT=9735 DEFAULT CHARSET=utf8;
303/*!40101 SET character_set_client = @saved_cs_client */;
304
305--
306-- Dumping data for table `transaction`
307--
308
309LOCK TABLES `transaction` WRITE;
310/*!40000 ALTER TABLE `transaction` DISABLE KEYS */;
311INSERT INTO `transaction` VALUES (2848,'2018-02-04',120),(3742,'2017-12-14',375),(4018,'2018-04-25',106),(4823,'2018-03-22',186),(5456,'2017-09-08',31),(7240,'2018-04-04',246),(8439,'2018-03-02',53),(8519,'2017-10-19',107),(9281,'2018-06-07',77),(9734,'2018-07-02',202);
312/*!40000 ALTER TABLE `transaction` ENABLE KEYS */;
313UNLOCK TABLES;
314/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
315
316/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
317/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
318/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
319/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
320/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
321/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
322/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
323
324-- Dump completed on 2018-08-02 13:42:33