ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
TASK 1:
2
Import the .csv file and create a new table and then fill out the data.
3
4
CREATE TABLE IF NOT EXISTS investment_subset (
5
market character varying,
6
funding_total_usd bigint,
7
status character varying,
8
country_code character varying,
9
founded_year integer,
10
seed bigint,
11
venture bigint,
12
equity_crowdfunding bigint,
13
undisclosed integer,
14
convertible_note integer,
15
debt_fincing bigint,
16
private_equity bigint
17
);
18
19
CREATE TABLE financial_table AS
20
SELECT * FROM investment_subset;
21
22
Filter the data that shows the market column containg Financial Services.
23
24
SELECT DISTINCT market FROM financial_table
25
WHERE market ILIKE 'Fin%';
26
27
UPDATE financial_table
28
SET market = 'FinancialServices'
29
WHERE market IN ('FincialServices'),
30
31
Replace column names.
32
33
ALTER TABLE financial_table
34
RENAME COLUMN funding_total_usd TO total_funding_usd;
35
ALTER TABLE financial_table
36
RENAME COLUMN founded_year TO year_founded;
37
ALTER TABLE financial_table
38
RENAME COLUMN undisclosed to undisclosed_source
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