-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.sql
78 lines (55 loc) · 1.23 KB
/
results.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
73
74
75
76
77
78
-- commands to create results database in RDS and using that to create PowerBI reports
create database results;
use results;
create table out_a(
key varchar(30),
value float
);
LOAD DATA LOCAL INFILE 'path_to_output_a'
INTO TABLE out_a
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n';
create table out_b(
key varchar(30),
value float
);
LOAD DATA LOCAL INFILE 'path_to_output_b'
INTO TABLE out_b
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n';
create table out_c(
key int,
value int
);
LOAD DATA LOCAL INFILE 'path_to_output_c'
INTO TABLE out_c
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
create table out_d(
key varchar(5),
value float
);
LOAD DATA LOCAL INFILE 'path_to_output_d'
INTO TABLE out_d
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n';
create table out_e(
key varchar(5),
value float
);
LOAD DATA LOCAL INFILE 'path_to_output_e'
INTO TABLE out_e
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
CREATE TABLE out_f(
month INT,
weekstatus VARCHAR(20),
daystatus VARCHAR(10),
Revenue float
);
LOAD DATA LOCAL INFILE 'path_to_output_f_transformed'
INTO TABLE out_f
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n';