File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ CREATE TABLE example.default.nation AS
2525SELECT * from tpch.tiny.nation;
2626```
2727
28+ Create the table orders, adding a table comment, adding a column comment and a column with default value:
29+
30+ ```
31+ CREATE TABLE IF NOT EXISTS orders (
32+ orderkey bigint,
33+ orderstatus varchar,
34+ totalprice double COMMENT 'Price in cents.',
35+ orderdate date,
36+ status varchar default 'created'
37+ )
38+ COMMENT 'A table to keep track of orders.'
39+ ```
40+
2841Insert data into a table in the Memory connector:
2942
3043```
Original file line number Diff line number Diff line change @@ -92,6 +92,12 @@ Add column `zip` to the `users` table:
9292ALTER TABLE users ADD COLUMN zip varchar;
9393```
9494
95+ Add column ` zip ` to the ` users ` table with default value as ` 90210 ` :
96+
97+ ```
98+ ALTER TABLE users ADD COLUMN zip varchar DEFAULT '90210';
99+ ```
100+
95101Add column ` zip ` to the ` users ` table if table ` users ` exists and column ` zip `
96102not already exists:
97103
Original file line number Diff line number Diff line change @@ -71,14 +71,15 @@ WITH (format = 'ORC')
7171```
7272
7373Create the table ` orders ` if it does not already exist, adding a table comment
74- and a column comment:
74+ and a column comment and a column with default value :
7575
7676```
7777CREATE TABLE IF NOT EXISTS orders (
7878 orderkey bigint,
7979 orderstatus varchar,
8080 totalprice double COMMENT 'Price in cents.',
81- orderdate date
81+ orderdate date,
82+ status varchar default 'created'
8283)
8384COMMENT 'A table to keep track of orders.'
8485```
You can’t perform that action at this time.
0 commit comments