-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbamazon.sql
More file actions
50 lines (34 loc) · 1.73 KB
/
Copy pathbamazon.sql
File metadata and controls
50 lines (34 loc) · 1.73 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
/* Creating and utilizing the datbase bamazon */
DROP DATABASE IF EXISTS bamazon_db;
CREATE DATABASE bamazon_db;
USE bamazon_db;
/* Creates a table "products" with columns (product_name, department_name, price, stock_quantity) */
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(100) NULL,
department_name VARCHAR(100) NULL,
price NUMERIC(10,2) NULL,
stock_quantity INT NULL,
PRIMARY KEY(item_id)
);
/* Create content to populate into 'products' table/'s rows */
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Playstation 5", "Electronics", 349.99, 20);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Apple Ipod Touch", "Electronics", 199.99, 15);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Chicken Nuggets", "Meat", 2.00, 20);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Hot Dogs", "Meat", 1.00, 15);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("T-Shirt", "Clothing", 9.25, 40);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Hoodie", "Clothing", 12.80, 18);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Vin's Diesel", "Automotive", 50.00, 13);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Car Wash", "Automotive", 5.50, 16);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Tea Tree oil", "Health & Beauty", 8.99, 80);
INSERT INTO products (product_name, department_name, price, stock_quantity)
VALUES ("Body Wash", "Health & Beauty", 5.99, 30);