File: alter_table.sql

package info (click to toggle)
sqlfluff 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,000 kB
  • sloc: python: 106,131; sql: 34,188; makefile: 52; sh: 8
file content (65 lines) | stat: -rw-r--r-- 1,655 bytes parent folder | download
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
ALTER TABLE example_table
    ADD CONSTRAINT example_name PRIMARY KEY (example_sk);

alter table users
rename to users_bkup;

alter table venue
owner to dwuser;

alter table vdate owner to vuser;

alter table venue
rename column venueseats to venuesize;

alter table category
drop constraint category_pkey;

alter table event alter column eventname type varchar(300);

create table t1(c0 int encode lzo, c1 bigint encode zstd, c2 varchar(16) encode lzo, c3 varchar(32) encode zstd);

alter table t1 alter column c0 encode az64;

alter table t1 alter column c1 encode az64;

alter table t1 alter column c2 encode bytedict;

alter table t1 alter column c3 encode runlength;

alter table inventory alter diststyle key distkey inv_warehouse_sk;

alter table inventory alter distkey inv_item_sk;

alter table inventory alter diststyle all;

alter table t1 alter sortkey(c0, c1);

alter table t1 alter sortkey none;

alter table t1 alter sortkey(c0, c1);

alter table t1 alter encode auto;

alter table t2 alter column c0 encode lzo;

ALTER TABLE the_schema.the_table ADD COLUMN the_timestamp TIMESTAMP;

ALTER TABLE the_schema.the_table ADD COLUMN the_boolean BOOLEAN DEFAULT FALSE;

alter table users
add column feedback_score int
default NULL;

alter table users drop column feedback_score;

alter table users
drop column feedback_score cascade;

ALTER TABLE the_schema.the_table APPEND FROM the_schema.the_temp_table IGNOREEXTRA FILLTARGET;

ALTER TABLE the_schema.the_table APPEND FROM the_schema.the_temp_table;

ALTER TABLE the_schema.the_table SET LOCATION 's3://bucket/folder/';

ALTER TABLE my_schema.my_table ADD COLUMN my_column BIGINT ENCODE ZSTD;