-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqonto_test_create_tables.sql
75 lines (53 loc) · 1.4 KB
/
qonto_test_create_tables.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
drop table if exists public.transactions ;
drop table if exists public.transaction_status ;
drop table if exists public.products ;
drop table if exists public.addresses ;
drop table if exists public.customers ;
create table public.transactions
(
id int NOT NULL PRIMARY KEY,
customer_id INT,
status_code INT,
product_id INT,
amount decimal,
created_at timestamp
);
copy public.transactions
from '/Users/bricedesoras/Desktop/Tables/transactions.csv' delimiters ',' CSV HEADER;
create table public.transaction_status
(
code INT not null primary key,
status char(16)
);
copy public.transaction_status
from '/Users/bricedesoras/Desktop/Tables/transaction_status.csv' delimiters ',' CSV HEADER;
create table public.products
(
id int NOT NULL PRIMARY KEY,
type char(16),
category char(16),
price decimal
);
copy public.products
from '/Users/bricedesoras/Desktop/Tables/products.csv' delimiters ',' CSV HEADER;
create table public.addresses
(
customer_id INT not null primary key,
zipcode char(16),
city char(24),
state char(2)
);
copy public.addresses
from '/Users/bricedesoras/Desktop/Tables/addresses.csv' delimiters ',' CSV HEADER;
create table public.customers
(
id INT not null primary key,
firstname char(16),
lastname char(16),
email char(30),
created_at timestamp,
country char(2),
gender char(1)
);
copy public.customers
from '/Users/bricedesoras/Desktop/Tables/customers.csv' delimiters ',' CSV HEADER;