-
Notifications
You must be signed in to change notification settings - Fork 3
/
ddl.sql
40 lines (29 loc) · 859 Bytes
/
ddl.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
begin;
set database_name = 'TMLS';
set schema_name = 'CFPB';
set role_name = '<insert_role>';
-- create database & schema
create database if not exists identifier($database_name);
-- grant access
grant CREATE SCHEMA, MONITOR, USAGE
on database identifier($database_name)
to role identifier($role_name);
use database identifier($database_name);
create schema if not exists identifier($schema_name);
grant all privileges
on schema identifier($schema_name)
to role identifier($role_name);
use schema identifier($schema_name);
create or replace TABLE MICRO_CONSUMER_COMPLAINTS (
ID NUMBER(38,0),
PRODUCT VARCHAR(16777216),
TEXT VARCHAR(16777216),
LABEL NUMBER(38,0)
);
create or replace TABLE SAMPLE_CONSUMER_COMPLAINTS (
ID NUMBER(38,0),
PRODUCT VARCHAR(16777216),
TEXT VARCHAR(16777216),
LABEL NUMBER(38,0)
);
commit;