-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzomato data files script.sql
51 lines (44 loc) · 1.31 KB
/
zomato data files script.sql
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
DROP TABLE IF EXISTS goldusers_signup;
CREATE TABLE goldusers_signup (userid INTEGER, gold_signup_date DATE);
INSERT INTO goldusers_signup (userid, gold_signup_date)
VALUES
(1, '2017-09-22'),
(3, '2017-04-21');
DROP TABLE IF EXISTS users;
CREATE TABLE users (userid INTEGER, signup_date DATE);
INSERT INTO users (userid, signup_date)
VALUES
(1, '2014-09-02'),
(2, '2015-01-15'),
(3, '2014-04-11');
DROP TABLE IF EXISTS sale;
CREATE TABLE sale (userid INTEGER, created_date DATE, product_id INTEGER);
INSERT INTO sale (userid, created_date, product_id)
VALUES
(1, '2017-04-19', 2),
(3, '2019-12-18', 1),
(2, '2020-07-20', 3),
(1, '2019-10-23', 2),
(1, '2018-03-19', 3),
(3, '2016-12-20', 2),
(1, '2016-11-09', 1),
(1, '2016-05-20', 3),
(2, '2017-09-24', 1),
(1, '2017-03-11', 2),
(1, '2016-03-11', 1),
(3, '2016-11-10', 1),
(3, '2017-12-07', 2),
(3, '2016-12-15', 2),
(2, '2017-11-08', 2),
(2, '2018-09-10', 3);
DROP TABLE IF EXISTS product;
CREATE TABLE product (product_id INTEGER, product_name TEXT, price INTEGER);
INSERT INTO product (product_id, product_name, price)
VALUES
(1, 'p1', 980),
(2, 'p2', 870),
(3, 'p3', 330);
select * from sale;
select * from product;
select * from goldusers_signup;
select * from users;