-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbamazon.sql
More file actions
109 lines (94 loc) · 4.62 KB
/
bamazon.sql
File metadata and controls
109 lines (94 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
-- MySQL dump 10.13 Distrib 5.7.12, for osx10.9 (x86_64)
--
-- Host: localhost Database: bamazon_db
-- ------------------------------------------------------
-- Server version 5.6.34
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `departments`
--
DROP TABLE IF EXISTS `departments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `departments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`department_name` varchar(30) NOT NULL,
`over_head_costs` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `departments`
--
LOCK TABLES `departments` WRITE;
/*!40000 ALTER TABLE `departments` DISABLE KEYS */;
INSERT INTO `departments` VALUES (1,'Books',355.00),(2,'Fondant & Gumpaste Supplies',245.20),(3,'Cake Pans & Equipment',400.00),(4,'Food Coloring',120.00);
/*!40000 ALTER TABLE `departments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`products_name` varchar(30) NOT NULL,
`department_id` int(11) NOT NULL,
`price` decimal(10,2) NOT NULL,
`stock_quantity` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `department_id` (`department_id`),
CONSTRAINT `products_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `departments` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,'Rolled Fondant 2 pounds',2,9.25,55),(2,'Gumpaste 2 pounds',2,9.25,55),(3,'Rolled Fondant 5 pounds',2,21.50,28),(4,'Gumpaste 5 pounds',2,21.50,31),(5,'Gumpaste mix 16oz',2,4.29,140),(6,'Round Cake Pan 3x3',3,4.70,33),(7,'Round Cake Pan 5x3',3,6.60,62),(8,'Round Cake Pan 7x3',3,8.50,80),(9,'Round Cake Pan 9x3',3,10.50,52),(10,'Square Cake Pan 4x4x2',3,8.99,47),(11,'The Cake Bible',1,20.83,12),(12,'Rose\'s Heavenly Cakes',1,27.15,23),(13,'The Contemporary Cake Decorati',1,11.99,52),(14,'Gel Color Burgundy Wine',4,1.35,125),(15,'Gel Color Royal Blue',4,1.35,125),(16,'Gel Color Leaf Green',4,1.35,125),(17,'Gel Color Deep Pink',4,1.35,125),(18,'Gel Color Orange',4,1.35,120),(19,'Gel Color Golden Yelow',4,1.35,125);
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sales`
--
DROP TABLE IF EXISTS `sales`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) DEFAULT NULL,
`quantity_purchased` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `product_id` (`product_id`),
CONSTRAINT `sales_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sales`
--
LOCK TABLES `sales` WRITE;
/*!40000 ALTER TABLE `sales` DISABLE KEYS */;
INSERT INTO `sales` VALUES (1,14,2,'2017-02-18 03:09:15'),(2,10,1,'2017-02-18 03:15:09'),(3,4,3,'2017-02-18 03:21:24'),(4,18,5,'2017-02-18 03:24:08'),(5,2,5,'2017-02-18 03:29:26');
/*!40000 ALTER TABLE `sales` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-02-17 23:23:41