Newer
Older
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
CREATE DATABASE addatabase;
use addatabase;
CREATE TABLE aditems(
item_name VARCHAR(40) NOT NULL,
redirect_url VARCHAR(100) NOT NULL,
text VARCHAR(100) NOT NULL,
PRIMARY KEY ( item_name )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("camera", "/product/2ZYFJ3GM2N", "Film camera for sale. 50% off.");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("lens", "/product/66VCHSJNUP", "Vintage camera lens for sale. 20% off.");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("recordPlayer", "/product/0PUK6V6EV0", "Vintage record player for sale. 30% off.");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("bike", "/product/9SIQT8TOJO", "City Bike for sale. 10% off.");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("baristaKit", "/product/1YMWWN1N4O", "Home Barista kitchen kit for sale. Buy one, get second kit for free");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("airPlant", "/product/6E92ZMYYFZ", "Air plants for sale. Buy two, get third one for free");
INSERT INTO aditems
(item_name, redirect_url, text)
VALUES
("terrarium", "/product/L9ECAV7KIM", "Terrarium for sale. Buy one, get second one for free");
# product db
CREATE DATABASE Productdb;
use Productdb;
CREATE TABLE products(
product_id VARCHAR(40) NOT NULL,
item_name VARCHAR(40) NOT NULL,
description VARCHAR(100) NOT NULL,
picture_path VARCHAR(100) NOT NULL,
categorise_list VARCHAR(100) NOT NULL,
PRIMARY KEY ( product_id )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE price(
product_id VARCHAR(40) NOT NULL,
currencyCode VARCHAR(10) NOT NULL,
units INT NOT NULL,
nanos INT,
PRIMARY KEY (product_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("OLJCESPC7Z", "Vintage Typewriter", "This typewriter looks good in your living room.", "/static/img/products/typewriter.jpg", "vintage");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("OLJCESPC7Z", "USD", 67, 990000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("66VCHSJNUP", "Antique Camera", "It probably doesn't work anyway.", "/static/img/products/camera-lens.jpg", "photography;vintage");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("66VCHSJNUP", "USD", 12, 490000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("1YMWWN1N4O", "Home Barista Kit", "Always wanted to brew coffee with Chemex and Aeropress at home?", "/static/img/products/barista-kit.jpg", "cookware");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("1YMWWN1N4O", "USD", 124, 0);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("L9ECAV7KIM", "Terrarium", "This terrarium will looks great in your white painted living room.", "/static/img/products/terrarium.jpg", "gardening");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("L9ECAV7KIM", "USD", 36, 450000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("2ZYFJ3GM2N", "Film Camera", "This camera looks like it's a film camera, but it's actually digital.", "/static/img/products/film-camera.jpg", "photography;vintage");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("2ZYFJ3GM2N", "USD", 2245, 0);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("0PUK6V6EV0", "Vintage Record Player", "It still works.", "/static/img/products/record-player.jpg", "music;vintage");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("0PUK6V6EV0", "USD", 65, 500000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("LS4PSXUNUM", "Metal Camping Mug", "You probably don't go camping that often but this is better than plastic cups.", "/static/img/products/camp-mug.jpg", "cookware");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("LS4PSXUNUM", "USD", 24, 330000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("9SIQT8TOJO", "City Bike", "This single gear bike probably cannot climb the hills of San Francisco.", "/static/img/products/city-bike.jpg", "cycling");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("9SIQT8TOJO", "USD", 789, 500000000);
INSERT INTO products
(product_id, item_name, description, picture_path, categorise_list)
VALUES
("6E92ZMYYFZ", "Air Plant", "Have you ever wondered whether air plants need water? Buy one and figure out.", "/static/img/products/air-plant.jpg", "gardening");
INSERT INTO price
(product_id, currencyCode, units, nanos)
VALUES
("6E92ZMYYFZ", "USD", 12, 300000000);