· 9 years ago · Apr 02, 2017, 09:44 PM
1-- MySQL dump 10.16 Distrib 10.1.19-MariaDB, for osx10.6 (i386)
2--
3-- Host: localhost Database: localhost
4-- ------------------------------------------------------
5-- Server version 10.1.19-MariaDB
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 `author`
20--
21
22DROP TABLE IF EXISTS `author`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `author` (
26 `aid` int(11) NOT NULL AUTO_INCREMENT,
27 `name` varchar(255) NOT NULL,
28 `address` varchar(255) NOT NULL,
29 `ssn` varchar(9) NOT NULL,
30 PRIMARY KEY (`aid`),
31 KEY `name` (`name`,`address`,`ssn`),
32 CONSTRAINT `author_ibfk_1` FOREIGN KEY (`name`, `address`, `ssn`) REFERENCES `people` (`name`, `address`, `ssn`)
33) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36--
37-- Dumping data for table `author`
38--
39
40LOCK TABLES `author` WRITE;
41/*!40000 ALTER TABLE `author` DISABLE KEYS */;
42INSERT INTO `author` VALUES (10,'Casey Ann','12 Infinite Loop Rd.','123640001'),(8,'Casey Ann','15 Stack Underflow Rd.','123640021'),(9,'Casey Ann','21 Stack Overflow Rd.','123641101'),(7,'Jane Harper','12 Reference Way','000645798'),(6,'Mariana Enriquez','12 Null Pointer St.','013645798'),(3,'Meg Howrey','12 Constraint St.','123645798'),(4,'Megan Hawkins','12 Assembly Way.','123475879'),(1,'Paul La Farge','123 Core Exception St.','123456789'),(5,'Paula Hawkins','12 C Sharp','188645798'),(2,'Sam Shepard','123 Arithmetic Exception St.','123546798');
43/*!40000 ALTER TABLE `author` ENABLE KEYS */;
44UNLOCK TABLES;
45
46--
47-- Table structure for table `book`
48--
49
50DROP TABLE IF EXISTS `book`;
51/*!40101 SET @saved_cs_client = @@character_set_client */;
52/*!40101 SET character_set_client = utf8 */;
53CREATE TABLE `book` (
54 `ISBN13` varchar(13) NOT NULL,
55 `title` varchar(255) NOT NULL,
56 `year` int(11) NOT NULL,
57 `category` varchar(255) NOT NULL,
58 `pname` varchar(255) NOT NULL,
59 `price` double NOT NULL,
60 PRIMARY KEY (`ISBN13`),
61 KEY `pname` (`pname`),
62 CONSTRAINT `book_ibfk_1` FOREIGN KEY (`pname`) REFERENCES `publisher` (`pname`)
63) ENGINE=InnoDB DEFAULT CHARSET=latin1;
64/*!40101 SET character_set_client = @saved_cs_client */;
65
66--
67-- Dumping data for table `book`
68--
69
70LOCK TABLES `book` WRITE;
71/*!40000 ALTER TABLE `book` DISABLE KEYS */;
72INSERT INTO `book` VALUES ('2124293979723','Track',2012,'Mystery','Microsoft',12.16),('2198206314351','The Fall',2016,'Drama','Angular Picks',20.99),('4755501624196','Better Me',2011,'Drama','Ubuntu',15.59),('4762078140862','Bags',2017,'Adventure','UMass',17.99),('5144830892793','A dreamer\'s Dream',2015,'Drama','Penguin Press',8.99),('5320250903721','Run',2011,'Adventure','Angular Picks',12.99),('5511832319898','Now',2010,'Mystery','Apple',22.99),('6703920528059','Beginning',2003,'Biography','Ubuntu',21.99),('6766827008919','Loser',2015,'Sports','Angular Picks',12.99),('6909634283510','ABC',2015,'Children','Penguin Press',22.99),('7434511509723','Since Tomorrow',2015,'Drama','Google',12.99),('8290559350046','New Dawn',2002,'Biography','Java Factory',11.99),('8881184298079','Pass',2009,'Drama','UMass',19.99),('9160808332496','Wrong choice',2016,'Horror','Division Papers',9.99),('9284187369746','The Game',2015,'War','Ubuntu',11.99),('9326375508447','Watch',2001,'Mystery','Boston Press',12.99);
73/*!40000 ALTER TABLE `book` ENABLE KEYS */;
74UNLOCK TABLES;
75
76--
77-- Table structure for table `cart`
78--
79
80DROP TABLE IF EXISTS `cart`;
81/*!40101 SET @saved_cs_client = @@character_set_client */;
82/*!40101 SET character_set_client = utf8 */;
83CREATE TABLE `cart` (
84 `cid` int(11) NOT NULL,
85 `ISBN13` varchar(13) NOT NULL,
86 `date_added` int(11) NOT NULL,
87 KEY `cid` (`cid`),
88 KEY `ISBN13` (`ISBN13`),
89 CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`cid`) REFERENCES `customer` (`cid`),
90 CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`ISBN13`) REFERENCES `book` (`ISBN13`)
91) ENGINE=InnoDB DEFAULT CHARSET=latin1;
92/*!40101 SET character_set_client = @saved_cs_client */;
93
94--
95-- Dumping data for table `cart`
96--
97
98LOCK TABLES `cart` WRITE;
99/*!40000 ALTER TABLE `cart` DISABLE KEYS */;
100/*!40000 ALTER TABLE `cart` ENABLE KEYS */;
101UNLOCK TABLES;
102
103--
104-- Table structure for table `customer`
105--
106
107DROP TABLE IF EXISTS `customer`;
108/*!40101 SET @saved_cs_client = @@character_set_client */;
109/*!40101 SET character_set_client = utf8 */;
110CREATE TABLE `customer` (
111 `cid` int(11) NOT NULL AUTO_INCREMENT,
112 `name` varchar(255) NOT NULL,
113 `address` varchar(255) NOT NULL,
114 `ssn` varchar(9) NOT NULL,
115 PRIMARY KEY (`cid`),
116 KEY `name` (`name`,`address`,`ssn`),
117 CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`name`, `address`, `ssn`) REFERENCES `people` (`name`, `address`, `ssn`)
118) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
119/*!40101 SET character_set_client = @saved_cs_client */;
120
121--
122-- Dumping data for table `customer`
123--
124
125LOCK TABLES `customer` WRITE;
126/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
127INSERT INTO `customer` VALUES (5,'Casey Ann','12 Infinite Loop Rd.','123640001'),(1,'Devin Bas','50 Some Street','982376459'),(8,'Jane Harper','12 Reference Way','000645798'),(2,'Janet Cross','192 Work Street','987646912'),(3,'Jason Garden','90 Old Way','982376459'),(4,'Kevin Garnett','1 Celtics Road','982376459'),(7,'Megan Hawkins','12 Assembly Way.','123475879'),(6,'Paula Hawkins','12 C Sharp','188645798');
128/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
129UNLOCK TABLES;
130
131--
132-- Table structure for table `people`
133--
134
135DROP TABLE IF EXISTS `people`;
136/*!40101 SET @saved_cs_client = @@character_set_client */;
137/*!40101 SET character_set_client = utf8 */;
138CREATE TABLE `people` (
139 `name` varchar(255) NOT NULL,
140 `address` varchar(255) NOT NULL,
141 `ssn` varchar(9) NOT NULL,
142 `telephone` varchar(10) NOT NULL,
143 `email` varchar(255) NOT NULL,
144 PRIMARY KEY (`name`,`address`,`ssn`)
145) ENGINE=InnoDB DEFAULT CHARSET=latin1;
146/*!40101 SET character_set_client = @saved_cs_client */;
147
148--
149-- Dumping data for table `people`
150--
151
152LOCK TABLES `people` WRITE;
153/*!40000 ALTER TABLE `people` DISABLE KEYS */;
154INSERT INTO `people` VALUES ('Casey Ann','12 Infinite Loop Rd.','123640001','9874568120','c.ann@inbox.com'),('Casey Ann','15 Stack Underflow Rd.','123640021','9874568120','c.ann@inbox.com'),('Casey Ann','21 Stack Overflow Rd.','123641101','9874568120','c.ann@inbox.com'),('Devin Bas','50 Some Street','982376459','121434878','devinbas@gmail.com'),('Jane Harper','12 Reference Way','000645798','1234001120','harper@yahoo.com'),('Janet Cross','192 Work Street','987646912','131536894','jcross@gmail.com'),('Jason Garden','90 Old Way','982376459','121432111','garden@hotmail.com'),('Kevin Garnett','1 Celtics Road','982376459','121222878','kg@gmail.com'),('Mariana Enriquez','12 Null Pointer St.','013645798','1233348120','mariana@hotmail.com'),('Meg Howrey','12 Constraint St.','123645798','1234568120','meg@hotmail.com'),('Megan Hawkins','12 Assembly Way.','123475879','9994568120','hawkins@hotmail.com'),('Paul La Farge','123 Core Exception St.','123456789','1234567890','paul@email.com'),('Paula Hawkins','12 C Sharp','188645798','1230008120','paulahawkins@gmail.com'),('Sam Shepard','123 Arithmetic Exception St.','123546798','1034567120','sam@gmail.com');
155/*!40000 ALTER TABLE `people` ENABLE KEYS */;
156UNLOCK TABLES;
157
158--
159-- Table structure for table `publisher`
160--
161
162DROP TABLE IF EXISTS `publisher`;
163/*!40101 SET @saved_cs_client = @@character_set_client */;
164/*!40101 SET character_set_client = utf8 */;
165CREATE TABLE `publisher` (
166 `pname` varchar(255) NOT NULL,
167 `city` varchar(255) NOT NULL,
168 `state` char(2) NOT NULL,
169 PRIMARY KEY (`pname`)
170) ENGINE=InnoDB DEFAULT CHARSET=latin1;
171/*!40101 SET character_set_client = @saved_cs_client */;
172
173--
174-- Dumping data for table `publisher`
175--
176
177LOCK TABLES `publisher` WRITE;
178/*!40000 ALTER TABLE `publisher` DISABLE KEYS */;
179INSERT INTO `publisher` VALUES ('Angular Picks','New York City','NY'),('Apple','San Francisco','CA'),('Boston Press','Lowell','MA'),('Division Papers','San Francisco','CA'),('Google','San Francisco','CA'),('Java Factory','Boston','MA'),('Microsoft','Redmond','WA'),('Penguin Press','Boston','MA'),('Ubuntu','Lowell','MA'),('UMass','Boston','MA');
180/*!40000 ALTER TABLE `publisher` ENABLE KEYS */;
181UNLOCK TABLES;
182
183--
184-- Table structure for table `purchase`
185--
186
187DROP TABLE IF EXISTS `purchase`;
188/*!40101 SET @saved_cs_client = @@character_set_client */;
189/*!40101 SET character_set_client = utf8 */;
190CREATE TABLE `purchase` (
191 `ISBN13` varchar(13) NOT NULL,
192 `cid` int(11) NOT NULL,
193 `datetime` int(11) NOT NULL,
194 PRIMARY KEY (`ISBN13`,`cid`,`datetime`),
195 KEY `cid` (`cid`),
196 CONSTRAINT `purchase_ibfk_1` FOREIGN KEY (`ISBN13`) REFERENCES `book` (`ISBN13`),
197 CONSTRAINT `purchase_ibfk_2` FOREIGN KEY (`cid`) REFERENCES `customer` (`cid`)
198) ENGINE=InnoDB DEFAULT CHARSET=latin1;
199/*!40101 SET character_set_client = @saved_cs_client */;
200
201--
202-- Dumping data for table `purchase`
203--
204
205LOCK TABLES `purchase` WRITE;
206/*!40000 ALTER TABLE `purchase` DISABLE KEYS */;
207INSERT INTO `purchase` VALUES ('2124293979723',1,1490277192),('2124293979723',2,1491272492),('2124293979723',4,1491274492),('2198206314351',1,1490275192),('2198206314351',4,1491273392),('4755501624196',7,1491272792),('4762078140862',7,1491217792),('5144830892793',7,1491277822),('5320250903721',2,1491272592),('5320250903721',4,1491276692),('5511832319898',1,1491272192),('5511832319898',3,1491271192),('6703920528059',7,1491279792),('6766827008919',2,1491272292),('6766827008919',3,1491272292),('6909634283510',2,1491272192),('6909634283510',7,1491274502),('7434511509723',4,1491275592),('7434511509723',7,1491219792),('8290559350046',5,1491270192),('8881184298079',2,1491272692),('8881184298079',6,1491290092),('9160808332496',2,1491272392),('9284187369746',2,1491272792),('9284187369746',4,1491277792);
208/*!40000 ALTER TABLE `purchase` ENABLE KEYS */;
209UNLOCK TABLES;
210
211--
212-- Table structure for table `stock`
213--
214
215DROP TABLE IF EXISTS `stock`;
216/*!40101 SET @saved_cs_client = @@character_set_client */;
217/*!40101 SET character_set_client = utf8 */;
218CREATE TABLE `stock` (
219 `warehouse_id` int(11) NOT NULL,
220 `ISBN13` varchar(13) NOT NULL,
221 `count` int(11) NOT NULL,
222 KEY `warehouse_id` (`warehouse_id`),
223 KEY `ISBN13` (`ISBN13`),
224 CONSTRAINT `stock_ibfk_1` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouse` (`id`),
225 CONSTRAINT `stock_ibfk_2` FOREIGN KEY (`ISBN13`) REFERENCES `book` (`ISBN13`)
226) ENGINE=InnoDB DEFAULT CHARSET=latin1;
227/*!40101 SET character_set_client = @saved_cs_client */;
228
229--
230-- Dumping data for table `stock`
231--
232
233LOCK TABLES `stock` WRITE;
234/*!40000 ALTER TABLE `stock` DISABLE KEYS */;
235/*!40000 ALTER TABLE `stock` ENABLE KEYS */;
236UNLOCK TABLES;
237
238--
239-- Table structure for table `warehouse`
240--
241
242DROP TABLE IF EXISTS `warehouse`;
243/*!40101 SET @saved_cs_client = @@character_set_client */;
244/*!40101 SET character_set_client = utf8 */;
245CREATE TABLE `warehouse` (
246 `id` int(11) NOT NULL AUTO_INCREMENT,
247 `city` varchar(255) NOT NULL,
248 `state` char(2) NOT NULL,
249 PRIMARY KEY (`id`)
250) ENGINE=InnoDB DEFAULT CHARSET=latin1;
251/*!40101 SET character_set_client = @saved_cs_client */;
252
253--
254-- Dumping data for table `warehouse`
255--
256
257LOCK TABLES `warehouse` WRITE;
258/*!40000 ALTER TABLE `warehouse` DISABLE KEYS */;
259/*!40000 ALTER TABLE `warehouse` ENABLE KEYS */;
260UNLOCK TABLES;
261
262--
263-- Table structure for table `writes`
264--
265
266DROP TABLE IF EXISTS `writes`;
267/*!40101 SET @saved_cs_client = @@character_set_client */;
268/*!40101 SET character_set_client = utf8 */;
269CREATE TABLE `writes` (
270 `ISBN13` varchar(13) NOT NULL,
271 `aid` int(11) NOT NULL,
272 PRIMARY KEY (`ISBN13`,`aid`),
273 KEY `aid` (`aid`),
274 CONSTRAINT `writes_ibfk_1` FOREIGN KEY (`ISBN13`) REFERENCES `book` (`ISBN13`),
275 CONSTRAINT `writes_ibfk_2` FOREIGN KEY (`aid`) REFERENCES `author` (`aid`)
276) ENGINE=InnoDB DEFAULT CHARSET=latin1;
277/*!40101 SET character_set_client = @saved_cs_client */;
278
279--
280-- Dumping data for table `writes`
281--
282
283LOCK TABLES `writes` WRITE;
284/*!40000 ALTER TABLE `writes` DISABLE KEYS */;
285INSERT INTO `writes` VALUES ('2124293979723',1),('2198206314351',1),('4755501624196',1),('4762078140862',2),('5144830892793',3),('5320250903721',4),('5511832319898',4),('5511832319898',9),('6703920528059',5),('6703920528059',8),('6766827008919',6),('6909634283510',7),('7434511509723',7),('8290559350046',7),('8881184298079',7),('9160808332496',8),('9284187369746',9),('9326375508447',2),('9326375508447',3),('9326375508447',10);
286/*!40000 ALTER TABLE `writes` ENABLE KEYS */;
287UNLOCK TABLES;
288/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
289
290/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
291/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
292/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
293/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
294/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
295/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
296/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
297
298-- Dump completed on 2017-04-02 16:53:36