Repository: sql-formatter-org/sql-formatter
Pull request #375 (2022-08-05 11:03:06)

Overhaul of DDL syntax variants
Covering the following:

- CREATE TABLE
- CREATE VIEW
- DROP TABLE
- ALTER TABLE

There are of course more, but these are the ones so far documented in our wiki.

The grammar variations of ALTER TABLE are huge. I only covered the very basic and most widespread syntax:

- ADD COLUMN
- DROP COLUMN
- ALTER COLUMN
- RENAME COLUMN
- RENAME TO
- MODIFY

The tests again don't attempt to cover all the variations in syntax, only the most important bits.


Patch:
diff --git a/src/languages/bigquery/bigquery.formatter.ts b/src/languages/bigquery/bigquery.formatter.ts
index 297996f6..1ea5bc74 100644
--- a/src/languages/bigquery/bigquery.formatter.ts
+++ b/src/languages/bigquery/bigquery.formatter.ts
@@ -35,13 +35,25 @@ const reservedCommands = expandPhrases([
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [BY SOURCE | BY TARGET] [THEN]',
   'UPDATE SET',
-  // DDL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
+  // Data definition, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
+  'CREATE [OR REPLACE] [MATERIALIZED] VIEW [IF NOT EXISTS]',
+  'CREATE [OR REPLACE] [TEMP|TEMPORARY|SNAPSHOT|EXTERNAL] TABLE [IF NOT EXISTS]',
+  'DROP [SNAPSHOT | EXTERNAL] TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE [IF EXISTS]',
+  'ADD COLUMN [IF NOT EXISTS]',
+  'DROP COLUMN [IF EXISTS]',
+  'RENAME TO',
+  'ALTER COLUMN [IF EXISTS]',
+  'SET DEFAULT COLLATE', // for alter column
+  'SET OPTIONS', // for alter column
+  'DROP NOT NULL', // for alter column
+  'SET DATA TYPE', // for alter column
+
   'CREATE SCHEMA [IF NOT EXISTS]',
   'DEFAULT COLLATE',
-  'CREATE [OR REPLACE] [TEMP|TEMPORARY|SNAPSHOT|EXTERNAL] TABLE [IF NOT EXISTS]',
   'CLUSTER BY',
   'FOR SYSTEM_TIME AS OF', // CREATE SNAPSHOT TABLE
-  'CREATE [OR REPLACE] [MATERIALIZED] VIEW [IF NOT EXISTS]',
   'WITH CONNECTION',
   'WITH PARTITION COLUMNS',
   'CREATE [OR REPLACE] [TEMP|TEMPORARY|TABLE] FUNCTION [IF NOT EXISTS]',
@@ -57,19 +69,10 @@ const reservedCommands = expandPhrases([
   'CREATE ASSIGNMENT',
   'CREATE SEARCH INDEX [IF NOT EXISTS]',
   'ALTER SCHEMA [IF EXISTS]',
-  'SET DEFAULT COLLATE',
-  'SET OPTIONS',
-  'ALTER TABLE [IF EXISTS]',
-  'ADD COLUMN [IF NOT EXISTS]',
-  'RENAME TO',
-  'DROP COLUMN [IF EXISTS]',
-  'ALTER COLUMN [IF EXISTS]',
-  'DROP NOT NULL',
-  'SET DATA TYPE',
+
   'ALTER [MATERIALIZED] VIEW [IF EXISTS]',
   'ALTER BI_CAPACITY',
   'DROP SCHEMA [IF EXISTS]',
-  'DROP [SNAPSHOT|EXTERNAL] TABLE [IF EXISTS]',
   'DROP [MATERIALIZED] VIEW [IF EXISTS]',
   'DROP [TABLE] FUNCTION [IF EXISTS]',
   'DROP PROCEDURE [IF EXISTS]',
diff --git a/src/languages/db2/db2.formatter.ts b/src/languages/db2/db2.formatter.ts
index 1b54ddc6..1e7c60c4 100644
--- a/src/languages/db2/db2.formatter.ts
+++ b/src/languages/db2/db2.formatter.ts
@@ -32,6 +32,20 @@ const reservedCommands = expandPhrases([
   'WHEN [NOT] MATCHED [THEN]',
   'UPDATE SET',
   'INSERT',
+  // Data definition
+  'CREATE [OR REPLACE] VIEW',
+  'CREATE [GLOBAL TEMPORARY] TABLE',
+  'DROP TABLE [HIERARCHY]',
+  // alter table:
+  'ALTER TABLE',
+  'ADD [COLUMN]',
+  'DROP [COLUMN]',
+  'RENAME [COLUMN]',
+  'ALTER [COLUMN]',
+  'SET DATA TYPE', // for alter column
+  'SET NOT NULL', // for alter column
+  'DROP {IDENTITY | EXPRESSION | DEFAULT | NOT NULL}', // for alter column
+
   // https://www.ibm.com/docs/en/db2-for-zos/11?topic=statements-list-supported
   'ALLOCATE CURSOR',
   'ALTER DATABASE',
@@ -42,7 +56,6 @@ const reservedCommands = expandPhrases([
   'ALTER PROCEDURE',
   'ALTER SEQUENCE',
   'ALTER STOGROUP',
-  'ALTER TABLE',
   'ALTER TABLESPACE',
   'ALTER TRIGGER',
   'ALTER TRUSTED CONTEXT',
@@ -68,13 +81,11 @@ const reservedCommands = expandPhrases([
   'CREATE SEQUENCE',
   'CREATE STOGROUP',
   'CREATE SYNONYM',
-  'CREATE TABLE',
   'CREATE TABLESPACE',
   'CREATE TRIGGER',
   'CREATE TRUSTED CONTEXT',
   'CREATE TYPE',
   'CREATE VARIABLE',
-  'CREATE VIEW',
   'DECLARE CURSOR',
   'DECLARE GLOBAL TEMPORARY TABLE',
   'DECLARE STATEMENT',
@@ -140,10 +151,7 @@ const reservedCommands = expandPhrases([
   'VALUES INTO',
   'WHENEVER',
   // other
-  'ADD',
-  'ALTER COLUMN',
   'AFTER',
-  'DROP TABLE',
   'GO',
   'SET CURRENT SCHEMA',
 ]);
diff --git a/src/languages/hive/hive.formatter.ts b/src/languages/hive/hive.formatter.ts
index 77b81019..de634093 100644
--- a/src/languages/hive/hive.formatter.ts
+++ b/src/languages/hive/hive.formatter.ts
@@ -44,16 +44,20 @@ const reservedCommands = expandPhrases([
   //   https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Loadingfilesintotables
   'LOAD DATA [LOCAL] INPATH',
   '[OVERWRITE] INTO TABLE',
+  // Data definition
+  'CREATE [MATERIALIZED] VIEW [IF NOT EXISTS]',
+  'CREATE [TEMPORARY] [EXTERNAL] TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE',
+  'RENAME TO',
+
   // other
   'ALTER',
-  'ALTER COLUMN', // added
-  'ALTER TABLE', // added
   'CREATE',
-  'CREATE TABLE', // added
   'USE',
   'DESCRIBE',
   'DROP',
-  'DROP TABLE', // added
   'FETCH',
   'SET SCHEMA', // added
   'SHOW',
diff --git a/src/languages/mariadb/mariadb.formatter.ts b/src/languages/mariadb/mariadb.formatter.ts
index 1d0eb9af..c21128d5 100644
--- a/src/languages/mariadb/mariadb.formatter.ts
+++ b/src/languages/mariadb/mariadb.formatter.ts
@@ -29,6 +29,21 @@ const reservedCommands = expandPhrases([
   'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
   // - truncate:
   'TRUNCATE [TABLE]',
+  // Data definition
+  'CREATE [OR REPLACE] [SQL SECURITY DEFINER | SQL SECURITY INVOKER] VIEW [IF NOT EXISTS]',
+  'CREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]',
+  'DROP [TEMPORARY] TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER [ONLINE] [IGNORE] TABLE [IF EXISTS]',
+  'ADD [COLUMN] [IF NOT EXISTS]',
+  '{CHANGE | MODIFY} [COLUMN] [IF EXISTS]',
+  'DROP [COLUMN] [IF EXISTS]',
+  'RENAME [TO]',
+  'RENAME COLUMN',
+  'ALTER [COLUMN]',
+  '{SET | DROP} DEFAULT', // for alter column
+  'SET {VISIBLE | INVISIBLE}', // for alter column
+
   // https://mariadb.com/docs/reference/mdb/sql-statements/
   'ALTER DATABASE',
   'ALTER DATABASE COMMENT',
@@ -39,7 +54,6 @@ const reservedCommands = expandPhrases([
   'ALTER SCHEMA COMMENT',
   'ALTER SEQUENCE',
   'ALTER SERVER',
-  'ALTER TABLE',
   'ALTER USER',
   'ALTER VIEW',
   'ANALYZE',
@@ -66,11 +80,9 @@ const reservedCommands = expandPhrases([
   'CREATE SEQUENCE',
   'CREATE SERVER',
   'CREATE SPATIAL INDEX',
-  'CREATE TABLE',
   'CREATE TRIGGER',
   'CREATE UNIQUE INDEX',
   'CREATE USER',
-  'CREATE VIEW',
   'DEALLOCATE PREPARE',
   'DESCRIBE',
   'DO',
@@ -83,7 +95,6 @@ const reservedCommands = expandPhrases([
   'DROP ROLE',
   'DROP SEQUENCE',
   'DROP SERVER',
-  'DROP TABLE',
   'DROP TRIGGER',
   'DROP USER',
   'DROP VIEW',
@@ -222,9 +233,6 @@ const reservedCommands = expandPhrases([
   'XA RECOVER',
   'XA ROLLBACK',
   'XA START',
-  // other
-  'ADD',
-  'ALTER COLUMN',
 ]);
 
 const reservedSetOperations = expandPhrases([
diff --git a/src/languages/mysql/mysql.formatter.ts b/src/languages/mysql/mysql.formatter.ts
index 6be1f47d..cd13f7fe 100644
--- a/src/languages/mysql/mysql.formatter.ts
+++ b/src/languages/mysql/mysql.formatter.ts
@@ -30,6 +30,20 @@ const reservedCommands = expandPhrases([
   'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
   // - truncate:
   'TRUNCATE [TABLE]',
+  // Data definition
+  'CREATE [OR REPLACE] [SQL SECURITY DEFINER | SQL SECURITY INVOKER] VIEW [IF NOT EXISTS]',
+  'CREATE [TEMPORARY] TABLE [IF NOT EXISTS]',
+  'DROP [TEMPORARY] TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE',
+  'ADD [COLUMN]',
+  '{CHANGE | MODIFY} [COLUMN]',
+  'DROP [COLUMN]',
+  'RENAME [TO | AS]',
+  'RENAME COLUMN',
+  'ALTER [COLUMN]',
+  '{SET | DROP} DEFAULT', // for alter column
+
   // https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html
   'ALTER DATABASE',
   'ALTER EVENT',
@@ -39,7 +53,6 @@ const reservedCommands = expandPhrases([
   'ALTER PROCEDURE',
   'ALTER RESOURCE GROUP',
   'ALTER SERVER',
-  'ALTER TABLE',
   'ALTER TABLESPACE',
   'ALTER USER',
   'ALTER VIEW',
@@ -65,11 +78,9 @@ const reservedCommands = expandPhrases([
   'CREATE ROLE',
   'CREATE SERVER',
   'CREATE SPATIAL REFERENCE SYSTEM',
-  'CREATE TABLE',
   'CREATE TABLESPACE',
   'CREATE TRIGGER',
   'CREATE USER',
-  'CREATE VIEW',
   'DEALLOCATE PREPARE',
   'DESCRIBE',
   'DO',
@@ -84,7 +95,6 @@ const reservedCommands = expandPhrases([
   'DROP ROLE',
   'DROP SERVER',
   'DROP SPATIAL REFERENCE SYSTEM',
-  'DROP TABLE',
   'DROP TABLESPACE',
   'DROP TRIGGER',
   'DROP USER',
@@ -196,9 +206,6 @@ const reservedCommands = expandPhrases([
   'REPEAT',
   'RETURN',
   'WHILE',
-  // other
-  'ADD',
-  'ALTER COLUMN',
 ]);
 
 const reservedSetOperations = expandPhrases(['UNION [ALL | DISTINCT]']);
diff --git a/src/languages/plsql/plsql.formatter.ts b/src/languages/plsql/plsql.formatter.ts
index 19c18324..abc727b4 100644
--- a/src/languages/plsql/plsql.formatter.ts
+++ b/src/languages/plsql/plsql.formatter.ts
@@ -31,23 +31,29 @@ const reservedCommands = expandPhrases([
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [THEN]',
   'UPDATE SET',
-  // other
-  'ADD',
-  'ALTER COLUMN',
+  // Data definition
+  'CREATE [OR REPLACE] [NO FORCE | FORCE] [EDITIONING | EDITIONABLE | EDITIONABLE EDITIONING | NONEDITIONABLE] VIEW',
+  'CREATE MATERIALIZED VIEW',
+  'CREATE [GLOBAL TEMPORARY | PRIVATE TEMPORARY | SHARDED | DUPLICATED | IMMUTABLE BLOCKCHAIN | BLOCKCHAIN | IMMUTABLE] TABLE',
+  'DROP TABLE',
+  // - alter table:
   'ALTER TABLE',
+  'ADD',
+  'DROP {COLUMN | UNUSED COLUMNS | COLUMNS CONTINUE}',
+  'MODIFY',
+  'RENAME TO',
+  'RENAME COLUMN',
+
+  // other
   'BEGIN',
   'CONNECT BY',
-  'CREATE TABLE',
-  'DROP TABLE',
   'DECLARE',
   'EXCEPT',
   'EXCEPTION',
   'LOOP',
-  'MODIFY',
   'RETURNING',
-  'SET CURRENT SCHEMA',
-  'SET SCHEMA',
   'START WITH',
+  'SET SCHEMA',
 ]);
 
 const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT', 'INTERSECT']);
diff --git a/src/languages/postgresql/postgresql.formatter.ts b/src/languages/postgresql/postgresql.formatter.ts
index 73397d71..c4f10a6d 100644
--- a/src/languages/postgresql/postgresql.formatter.ts
+++ b/src/languages/postgresql/postgresql.formatter.ts
@@ -30,6 +30,23 @@ const reservedCommands = expandPhrases([
   'DELETE FROM [ONLY]',
   // - truncate:
   'TRUNCATE [TABLE] [ONLY]',
+  // Data definition
+  'CREATE [OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE] VIEW',
+  'CREATE MATERIALIZED VIEW [IF NOT EXISTS]',
+  'CREATE [GLOBAL | LOCAL] [TEMPORARY | TEMP | UNLOGGED] TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE [IF EXISTS] [ONLY]',
+  'ALTER TABLE ALL IN TABLESPACE',
+  'RENAME [COLUMN]',
+  'RENAME TO',
+  'ADD [COLUMN] [IF NOT EXISTS]',
+  'DROP [COLUMN] [IF EXISTS]',
+  'ALTER [COLUMN]',
+  '[SET DATA] TYPE', // for alter column
+  '{SET | DROP} DEFAULT', // for alter column
+  '{SET | DROP} NOT NULL', // for alter column
+
   // https://www.postgresql.org/docs/14/sql-commands.html
   'ABORT',
   'ALTER AGGREGATE',
@@ -63,7 +80,6 @@ const reservedCommands = expandPhrases([
   'ALTER STATISTICS',
   'ALTER SUBSCRIPTION',
   'ALTER SYSTEM',
-  'ALTER TABLE',
   'ALTER TABLESPACE',
   'ALTER TEXT SEARCH CONFIGURATION',
   'ALTER TEXT SEARCH DICTIONARY',
@@ -99,7 +115,6 @@ const reservedCommands = expandPhrases([
   'CREATE GROUP',
   'CREATE INDEX',
   'CREATE LANGUAGE',
-  'CREATE MATERIALIZED VIEW',
   'CREATE OPERATOR',
   'CREATE OPERATOR CLASS',
   'CREATE OPERATOR FAMILY',
@@ -113,8 +128,6 @@ const reservedCommands = expandPhrases([
   'CREATE SERVER',
   'CREATE STATISTICS',
   'CREATE SUBSCRIPTION',
-  'CREATE TABLE',
-  'CREATE TABLE AS',
   'CREATE TABLESPACE',
   'CREATE TEXT SEARCH CONFIGURATION',
   'CREATE TEXT SEARCH DICTIONARY',
@@ -125,7 +138,6 @@ const reservedCommands = expandPhrases([
   'CREATE TYPE',
   'CREATE USER',
   'CREATE USER MAPPING',
-  'CREATE VIEW',
   'DEALLOCATE',
   'DECLARE',
   'DISCARD',
@@ -161,7 +173,6 @@ const reservedCommands = expandPhrases([
   'DROP SERVER',
   'DROP STATISTICS',
   'DROP SUBSCRIPTION',
-  'DROP TABLE',
   'DROP TABLESPACE',
   'DROP TEXT SEARCH CONFIGURATION',
   'DROP TEXT SEARCH DICTIONARY',
@@ -207,9 +218,7 @@ const reservedCommands = expandPhrases([
   'UNLISTEN',
   'VACUUM',
   // other
-  'ADD',
   'AFTER',
-  'ALTER COLUMN',
   'SET SCHEMA',
 ]);
 
diff --git a/src/languages/redshift/redshift.formatter.ts b/src/languages/redshift/redshift.formatter.ts
index 396b082c..809a85d9 100644
--- a/src/languages/redshift/redshift.formatter.ts
+++ b/src/languages/redshift/redshift.formatter.ts
@@ -26,6 +26,21 @@ const reservedCommands = expandPhrases([
   'DELETE [FROM]',
   // - truncate:
   'TRUNCATE [TABLE]',
+  // Data definition
+  'CREATE [OR REPLACE | MATERIALIZED] VIEW',
+  'CREATE [TEMPORARY | TEMP | LOCAL TEMPORARY | LOCAL TEMP] TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE',
+  'ALTER TABLE APPEND',
+  'ADD [COLUMN]',
+  'DROP [COLUMN]',
+  'RENAME TO',
+  'RENAME COLUMN',
+  'ALTER COLUMN',
+  'TYPE', // for alter column
+  'ENCODE', // for alter column
+
   // https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html
   'ABORT',
   'ALTER DATABASE',
@@ -35,8 +50,6 @@ const reservedCommands = expandPhrases([
   'ALTER MATERIALIZED VIEW',
   'ALTER PROCEDURE',
   'ALTER SCHEMA',
-  'ALTER TABLE',
-  'ALTER TABLE APPEND',
   'ALTER USER',
   'ANALYSE',
   'ANALYZE',
@@ -57,14 +70,10 @@ const reservedCommands = expandPhrases([
   'CREATE FUNCTION',
   'CREATE GROUP',
   'CREATE LIBRARY',
-  'CREATE MATERIALIZED VIEW',
   'CREATE MODEL',
   'CREATE PROCEDURE',
   'CREATE SCHEMA',
-  'CREATE TABLE',
-  'CREATE TABLE AS',
   'CREATE USER',
-  'CREATE VIEW',
   'DEALLOCATE',
   'DECLARE',
   'DESC DATASHARE',
@@ -77,7 +86,6 @@ const reservedCommands = expandPhrases([
   'DROP MATERIALIZED VIEW',
   'DROP PROCEDURE',
   'DROP SCHEMA',
-  'DROP TABLE',
   'DROP USER',
   'DROP VIEW',
   'DROP',
diff --git a/src/languages/spark/spark.formatter.ts b/src/languages/spark/spark.formatter.ts
index bdebc6dd..c32414a7 100644
--- a/src/languages/spark/spark.formatter.ts
+++ b/src/languages/spark/spark.formatter.ts
@@ -33,18 +33,24 @@ const reservedCommands = expandPhrases([
   //   https://spark.apache.org/docs/latest/sql-ref-syntax-dml-load.html
   'LOAD DATA [LOCAL] INPATH',
   '[OVERWRITE] INTO TABLE',
-  // DDL
+  // Data definition
+  'CREATE [OR REPLACE] [GLOBAL TEMPORARY | TEMPORARY] VIEW [IF NOT EXISTS]',
+  'CREATE [EXTERNAL] TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE',
+  'ADD COLUMNS',
+  'DROP {COLUMN | COLUMNS}',
+  'RENAME TO',
+  'RENAME COLUMN',
   'ALTER COLUMN',
+
   'ALTER DATABASE',
-  'ALTER TABLE',
   'ALTER VIEW',
   'CREATE DATABASE',
   'CREATE FUNCTION',
-  'CREATE TABLE',
-  'CREATE VIEW',
   'DROP DATABASE',
   'DROP FUNCTION',
-  'DROP TABLE',
   'DROP VIEW',
   'REPAIR TABLE',
   'USE DATABASE',
diff --git a/src/languages/sql/sql.formatter.ts b/src/languages/sql/sql.formatter.ts
index b7efdbed..b3e47596 100644
--- a/src/languages/sql/sql.formatter.ts
+++ b/src/languages/sql/sql.formatter.ts
@@ -30,12 +30,23 @@ const reservedCommands = expandPhrases([
   'DELETE FROM',
   // - truncate:
   'TRUNCATE TABLE',
-  // other
-  'ADD',
-  'ALTER COLUMN',
-  'ALTER TABLE',
-  'CREATE TABLE',
+  // Data definition
+  'CREATE [RECURSIVE] VIEW',
+  'CREATE [GLOBAL TEMPORARY | LOCAL TEMPORARY] TABLE',
   'DROP TABLE',
+  // - alter table:
+  'ALTER TABLE',
+  'ADD COLUMN',
+  'DROP [COLUMN]',
+  'RENAME COLUMN',
+  'RENAME TO',
+  'ALTER [COLUMN]',
+  '{SET | DROP} DEFAULT', // for alter column
+  'ADD SCOPE', // for alter column
+  'DROP SCOPE {CASCADE | RESTRICT}', // for alter column
+  'RESTART WITH', // for alter column
+
+  // other
   'SET SCHEMA',
 ]);
 
diff --git a/src/languages/sqlite/sqlite.formatter.ts b/src/languages/sqlite/sqlite.formatter.ts
index b9716d23..02844751 100644
--- a/src/languages/sqlite/sqlite.formatter.ts
+++ b/src/languages/sqlite/sqlite.formatter.ts
@@ -27,12 +27,18 @@ const reservedCommands = expandPhrases([
   'SET',
   // - delete:
   'DELETE FROM',
-  // other
-  'ADD',
-  'ALTER COLUMN',
+  // Data definition
+  'CREATE [TEMPORARY | TEMP] VIEW [IF NOT EXISTS]',
+  'CREATE [TEMPORARY | TEMP] TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
   'ALTER TABLE',
-  'CREATE TABLE',
-  'DROP TABLE',
+  'ADD [COLUMN]',
+  'DROP [COLUMN]',
+  'RENAME [COLUMN]',
+  'RENAME TO',
+
+  // other
   'SET SCHEMA',
 ]);
 
diff --git a/src/languages/trino/trino.formatter.ts b/src/languages/trino/trino.formatter.ts
index 5a6c1f3b..3f769abd 100644
--- a/src/languages/trino/trino.formatter.ts
+++ b/src/languages/trino/trino.formatter.ts
@@ -30,27 +30,26 @@ const reservedCommands = expandPhrases([
   'DELETE FROM',
   // - truncate:
   'TRUNCATE TABLE',
-  // DDL
-  'ALTER SCHEMA',
-  'ALTER TABLE',
+  // Data definition
+  'CREATE [OR REPLACE] [MATERIALIZED] VIEW',
+  'CREATE TABLE [IF NOT EXISTS]',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE [IF EXISTS]',
+  'ADD COLUMN [IF NOT EXISTS]',
+  'DROP COLUMN [IF EXISTS]',
+  'RENAME COLUMN [IF EXISTS]',
   'RENAME TO',
-  'ADD COLUMN',
-  'RENAME COLUMN',
-  'DROP COLUMN',
-  'SET AUTHORIZATION',
+  'SET AUTHORIZATION [USER | ROLE]',
   'SET PROPERTIES',
   'EXECUTE',
+
+  'ALTER SCHEMA',
   'ALTER MATERIALIZED VIEW',
   'ALTER VIEW',
   'CREATE SCHEMA',
-  'CREATE TABLE',
-  'CREATE VIEW',
-  'CREATE OR REPLACE VIEW',
-  'CREATE MATERIALIZED VIEW',
-  'CREATE OR REPLACE MATERIALIZED VIEW',
   'CREATE ROLE',
   'DROP SCHEMA',
-  'DROP TABLE',
   'DROP COLUMN',
   'DROP MATERIALIZED VIEW',
   'DROP VIEW',
diff --git a/src/languages/tsql/tsql.formatter.ts b/src/languages/tsql/tsql.formatter.ts
index 6990bac5..dbcf8972 100644
--- a/src/languages/tsql/tsql.formatter.ts
+++ b/src/languages/tsql/tsql.formatter.ts
@@ -33,6 +33,16 @@ const reservedCommands = expandPhrases([
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [BY TARGET | BY SOURCE] [THEN]',
   'UPDATE SET',
+  // Data definition
+  'CREATE [OR ALTER] [MATERIALIZED] VIEW',
+  'CREATE TABLE',
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE',
+  'ADD',
+  'DROP COLUMN [IF EXISTS]',
+  'ALTER COLUMN',
+
   // https://docs.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver15
   'ADD SENSITIVITY CLASSIFICATION',
   'ADD SIGNATURE',
@@ -81,7 +91,6 @@ const reservedCommands = expandPhrases([
   'DATEFIRST',
   'DATEFORMAT',
   'DEADLOCK_PRIORITY',
-  'DEFAULT',
   'DENY',
   'DENY XML',
   'DISABLE TRIGGER',
@@ -184,16 +193,10 @@ const reservedCommands = expandPhrases([
   'TYPE',
   'UPDATE STATISTICS',
   'USER',
-  'VIEW',
   'WORKLOAD GROUP',
   'XACT_ABORT',
   'XML INDEX',
   'XML SCHEMA COLLECTION',
-  // other
-  'ALTER COLUMN',
-  'ALTER TABLE',
-  'CREATE TABLE',
-  'DROP TABLE',
 ]);
 
 const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT', 'INTERSECT']);


Test patch:
diff --git a/test/behavesLikeMariaDbFormatter.ts b/test/behavesLikeMariaDbFormatter.ts
index 1409c23b..0f62b363 100644
--- a/test/behavesLikeMariaDbFormatter.ts
+++ b/test/behavesLikeMariaDbFormatter.ts
@@ -3,7 +3,6 @@ import dedent from 'dedent-js';
 import { FormatFn } from 'src/sqlFormatter';
 import behavesLikeSqlFormatter from './behavesLikeSqlFormatter';
 
-import supportsCreateTable from './features/createTable';
 import supportsDropTable from './features/dropTable';
 import supportsAlterTable from './features/alterTable';
 import supportsBetween from './features/between';
@@ -16,6 +15,7 @@ import supportsParams from './options/param';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
 
 /**
  * Shared tests for MySQL and MariaDB
@@ -25,10 +25,16 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) {
   supportsComments(format, { hashComments: true });
   supportsStrings(format, ["''", '""', "X''"]);
   supportsIdentifiers(format, ['``']);
-  supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsCreateView(format, { orReplace: true });
+  supportsDropTable(format, { ifExists: true });
   supportsConstraints(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    modify: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format, { withoutInto: true });
   supportsUpdate(format);
@@ -101,7 +107,9 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) {
   it('does not wrap CHARACTER SET to multiple lines', () => {
     expect(format('ALTER TABLE t MODIFY col1 VARCHAR(50) CHARACTER SET greek')).toBe(dedent`
       ALTER TABLE
-        t MODIFY col1 VARCHAR(50) CHARACTER SET greek
+        t
+      MODIFY
+        col1 VARCHAR(50) CHARACTER SET greek
     `);
   });
 
@@ -114,4 +122,26 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) {
         (2, 'Dog');
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(
+      format(
+        `ALTER TABLE t ALTER COLUMN foo SET DEFAULT 10;
+         ALTER TABLE t ALTER COLUMN foo DROP DEFAULT`
+      )
+    ).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET DEFAULT
+        10;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      DROP DEFAULT
+    `);
+  });
 }
diff --git a/test/bigquery.test.ts b/test/bigquery.test.ts
index ba218eef..797100ed 100644
--- a/test/bigquery.test.ts
+++ b/test/bigquery.test.ts
@@ -23,6 +23,8 @@ import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
 import supportsMergeInto from './features/mergeInto';
+import supportsCreateView from './features/createView';
+import supportsAlterTable from './features/alterTable';
 
 describe('BigQueryFormatter', () => {
   const language = 'bigquery';
@@ -30,8 +32,14 @@ describe('BigQueryFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format, { hashComments: true });
-  supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsCreateView(format, { orReplace: true, materialized: true });
+  supportsCreateTable(format, { orReplace: true, ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+  });
   supportsDeleteFrom(format, { withoutFrom: true });
   supportsInsertInto(format, { withoutInto: true });
   supportsUpdate(format);
@@ -300,27 +308,6 @@ describe('BigQueryFormatter', () => {
   describe('BigQuery DDL Create Statements', () => {
     const createCmds = {
       schema: ['CREATE SCHEMA', 'CREATE SCHEMA IF NOT EXISTS'],
-      table: ['CREATE TABLE', 'CREATE TABLE IF NOT EXISTS', 'CREATE OR REPLACE TABLE'],
-      tempTable: [
-        'CREATE TEMP TABLE',
-        'CREATE TEMP TABLE IF NOT EXISTS',
-        'CREATE TEMPORARY TABLE',
-        'CREATE TEMPORARY TABLE IF NOT EXISTS',
-        'CREATE OR REPLACE TEMP TABLE',
-        'CREATE OR REPLACE TEMPORARY TABLE',
-      ],
-      snapshotTable: ['CREATE SNAPSHOT TABLE', 'CREATE SNAPSHOT TABLE IF NOT EXISTS'],
-      view: ['CREATE VIEW', 'CREATE OR REPLACE VIEW', 'CREATE VIEW IF NOT EXISTS'],
-      materializedView: [
-        'CREATE MATERIALIZED VIEW',
-        'CREATE OR REPLACE MATERIALIZED VIEW',
-        'CREATE MATERIALIZED VIEW IF NOT EXISTS',
-      ],
-      externalTable: [
-        'CREATE EXTERNAL TABLE',
-        'CREATE OR REPLACE EXTERNAL TABLE',
-        'CREATE EXTERNAL TABLE IF NOT EXISTS',
-      ],
       function: ['CREATE FUNCTION', 'CREATE OR REPLACE FUNCTION', 'CREATE FUNCTION IF NOT EXISTS'],
       tempFunction: [
         'CREATE TEMP FUNCTION',
@@ -368,40 +355,6 @@ describe('BigQueryFormatter', () => {
       });
     });
 
-    createCmds.table.concat(createCmds.tempTable).forEach((createTable: string) => {
-      it(`Supports ${createTable}`, () => {
-        const input = `
-          ${createTable} mydataset.newtable
-          (
-            x INT64 OPTIONS(description="desc1"),
-            y STRUCT<
-              a ARRAY<STRING> OPTIONS(description="desc2"),
-              b BOOL
-            >
-          )
-          PARTITION BY _PARTITIONDATE
-          OPTIONS(
-            expiration_timestamp=TIMESTAMP "2025-01-01 00:00:00 UTC",
-            partition_expiration_days=1
-          )`;
-
-        // TODO: need to fix the formatting of y STRUCT<a ARRAY<STRING>OPTIONS(description ="desc2"), b BOOL>
-        const expected = dedent`
-          ${createTable}
-            mydataset.newtable (
-              x INT64 OPTIONS(description = "desc1"),
-              y STRUCT<a ARRAY<STRING>OPTIONS(description ="desc2"), b BOOL>
-            )
-          PARTITION BY
-            _PARTITIONDATE OPTIONS(
-              expiration_timestamp = TIMESTAMP "2025-01-01 00:00:00 UTC",
-              partition_expiration_days = 1
-            )`;
-
-        expect(format(input)).toBe(expected);
-      });
-    });
-
     it(`Supports CREATE TABLE LIKE`, () => {
       const input = `
         CREATE TABLE mydataset.newtable
@@ -441,56 +394,23 @@ describe('BigQueryFormatter', () => {
       expect(format(input)).toBe(expected);
     });
 
-    createCmds.snapshotTable.forEach(createSnapshotTable => {
-      it(`Supports ${createSnapshotTable}`, () => {
-        const input = `
-          ${createSnapshotTable} mydataset.mytablesnapshot
-          CLONE mydataset.mytable`;
-        const expected = dedent`
-          ${createSnapshotTable}
-            mydataset.mytablesnapshot CLONE mydataset.mytable`;
-
-        expect(format(input)).toBe(expected);
-      });
-    });
-
-    createCmds.view.concat(createCmds.materializedView).forEach(createView => {
-      it(`Supports ${createView}`, () => {
-        const input = `
-          ${createView} my_dataset.my_view AS (
-          SELECT t1.col1, t1.col2 FROM my_dataset.my_table)`;
-        const expected = dedent`
-          ${createView}
-            my_dataset.my_view AS (
-              SELECT
-                t1.col1,
-                t1.col2
-              FROM
-                my_dataset.my_table
-            )`;
-        expect(format(input)).toBe(expected);
-      });
-    });
-
-    createCmds.externalTable.forEach(createExternalTable => {
-      it(`Supports ${createExternalTable}`, () => {
-        const input = `
-          ${createExternalTable} dataset.CsvTable
-          WITH PARTITION COLUMNS (
-            field_1 STRING,
-            field_2 INT64
-          )
-          OPTIONS(
-            format = 'CSV',
-            uris = ['gs://bucket/path1.csv']
-          )`;
-        const expected = dedent`
-          ${createExternalTable}
-            dataset.CsvTable
-          WITH PARTITION COLUMNS
-            (field_1 STRING, field_2 INT64) OPTIONS(format = 'CSV', uris = ['gs://bucket/path1.csv'])`;
-        expect(format(input)).toBe(expected);
-      });
+    it(`Supports CREATE EXTERNAL TABLE ... WITH PARTITION COLUMN`, () => {
+      const input = `
+        CREATE EXTERNAL TABLE dataset.CsvTable
+        WITH PARTITION COLUMNS (
+          field_1 STRING,
+          field_2 INT64
+        )
+        OPTIONS(
+          format = 'CSV',
+          uris = ['gs://bucket/path1.csv']
+        )`;
+      const expected = dedent`
+        CREATE EXTERNAL TABLE
+          dataset.CsvTable
+        WITH PARTITION COLUMNS
+          (field_1 STRING, field_2 INT64) OPTIONS(format = 'CSV', uris = ['gs://bucket/path1.csv'])`;
+      expect(format(input)).toBe(expected);
     });
 
     createCmds.function.concat(createCmds.tempFunction).forEach(createFunction => {
@@ -658,26 +578,16 @@ describe('BigQueryFormatter', () => {
   });
 
   describe('BigQuery DDL Alter Statements', () => {
-    const alterCmds = {
-      schema: ['ALTER SCHEMA', 'ALTER SCHEMA IF EXISTS'],
-      table: ['ALTER TABLE', 'ALTER TABLE IF EXISTS'],
-      column: ['ALTER COLUMN', 'ALTER COLUMN IF EXISTS'],
-      view: ['ALTER VIEW', 'ALTER VIEW IF EXISTS'],
-      materializedView: ['ALTER MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW IF EXISTS'],
-    };
-
-    alterCmds.schema.forEach(alterSchema => {
-      it(`Supports ${alterSchema} - SET DEFAULT COLLATE`, () => {
-        const input = `
-          ${alterSchema} mydataset
-          SET DEFAULT COLLATE 'und:ci'`;
-        const expected = dedent`
-          ${alterSchema}
-            mydataset
-          SET DEFAULT COLLATE
-            'und:ci'`;
-        expect(format(input)).toBe(expected);
-      });
+    it(`Supports ALTER SCHEMA - SET DEFAULT COLLATE`, () => {
+      const input = `
+        ALTER SCHEMA mydataset
+        SET DEFAULT COLLATE 'und:ci'`;
+      const expected = dedent`
+        ALTER SCHEMA
+          mydataset
+        SET DEFAULT COLLATE
+          'und:ci'`;
+      expect(format(input)).toBe(expected);
     });
 
     it(`Supports ALTER SCHEMA - SET OPTIONS`, () => {
@@ -694,96 +604,51 @@ describe('BigQueryFormatter', () => {
       expect(format(input)).toBe(expected);
     });
 
-    alterCmds.table.forEach(alterTable => {
-      it(`Supports ${alterTable} - SET OPTIONS`, () => {
-        const input = `
-          ${alterTable} mydataset.mytable
-          SET OPTIONS(
-            expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
-          )`;
-        const expected = dedent`
-          ${alterTable}
-            mydataset.mytable
-          SET OPTIONS
-            (
-              expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
-            )`;
-        expect(format(input)).toBe(expected);
-      });
-    });
-
-    it(`Supports ALTER TABLE - ADD COLUMN`, () => {
+    it(`Supports ALTER TABLE - SET OPTIONS`, () => {
       const input = `
         ALTER TABLE mydataset.mytable
-        ADD COLUMN col1 STRING,
-        ADD COLUMN IF NOT EXISTS col2 GEOGRAPHY`;
-      const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        ADD COLUMN
-          col1 STRING,
-        ADD COLUMN IF NOT EXISTS
-          col2 GEOGRAPHY`;
-      expect(format(input)).toBe(expected);
-    });
-
-    it(`Supports ALTER TABLE - RENAME TO`, () => {
-      const input = `
-        ALTER TABLE mydataset.mytable RENAME TO mynewtable`;
+        SET OPTIONS(
+          expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+        )`;
       const expected = dedent`
         ALTER TABLE
           mydataset.mytable
-        RENAME TO
-          mynewtable`;
+        SET OPTIONS
+          (
+            expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+          )`;
       expect(format(input)).toBe(expected);
     });
 
-    it(`Supports ALTER TABLE - DROP COLUMN`, () => {
+    it(`Supports ALTER TABLE - SET DEFAULT COLLATE`, () => {
       const input = `
         ALTER TABLE mydataset.mytable
-        DROP COLUMN col1,
-        DROP COLUMN IF EXISTS col2`;
+        SET DEFAULT COLLATE 'und:ci'`;
       const expected = dedent`
         ALTER TABLE
           mydataset.mytable
-        DROP COLUMN
-          col1,
-        DROP COLUMN IF EXISTS
-          col2`;
+        SET DEFAULT COLLATE
+          'und:ci'`;
       expect(format(input)).toBe(expected);
     });
 
-    it(`Supports ALTER TABLE - SET DEFAULT COLLATE`, () => {
+    it(`Supports ALTER COLUMN - SET OPTIONS`, () => {
       const input = `
         ALTER TABLE mydataset.mytable
-        SET DEFAULT COLLATE 'und:ci'`;
+        ALTER COLUMN price
+        SET OPTIONS (
+          description="Price per unit"
+        )`;
       const expected = dedent`
         ALTER TABLE
           mydataset.mytable
-        SET DEFAULT COLLATE
-          'und:ci'`;
+        ALTER COLUMN
+          price
+        SET OPTIONS
+          (description = "Price per unit")`;
       expect(format(input)).toBe(expected);
     });
 
-    alterCmds.column.forEach(alterColumn => {
-      it(`Supports ${alterColumn} - SET OPTIONS`, () => {
-        const input = `
-          ALTER TABLE mydataset.mytable
-          ${alterColumn} price
-          SET OPTIONS (
-            description="Price per unit"
-          )`;
-        const expected = dedent`
-          ALTER TABLE
-            mydataset.mytable
-          ${alterColumn}
-            price
-          SET OPTIONS
-            (description = "Price per unit")`;
-        expect(format(input)).toBe(expected);
-      });
-    });
-
     it(`Supports ALTER COLUMN - DROP NOT NULL`, () => {
       const input = `
         ALTER TABLE mydataset.mytable
@@ -813,22 +678,20 @@ describe('BigQueryFormatter', () => {
       expect(format(input)).toBe(expected);
     });
 
-    alterCmds.view.concat(alterCmds.materializedView).forEach(alterView => {
-      it(`Supports ${alterView} - SET OPTIONS`, () => {
-        const input = `
-          ${alterView} mydataset.myview
-          SET OPTIONS (
-            expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+    it(`Supports ALTER VIEW - SET OPTIONS`, () => {
+      const input = `
+        ALTER VIEW mydataset.myview
+        SET OPTIONS (
+          expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+        )`;
+      const expected = dedent`
+        ALTER VIEW
+          mydataset.myview
+        SET OPTIONS
+          (
+            expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
           )`;
-        const expected = dedent`
-          ${alterView}
-            mydataset.myview
-          SET OPTIONS
-            (
-              expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
-            )`;
-        expect(format(input)).toBe(expected);
-      });
+      expect(format(input)).toBe(expected);
     });
 
     it(`Supports ALTER BI_CAPACITY - SET OPTIONS`, () => {
@@ -849,9 +712,6 @@ describe('BigQueryFormatter', () => {
   describe('BigQuery DDL Drop Statements', () => {
     const dropCmds = {
       schema: ['DROP SCHEMA', 'DROP SCHEMA IF EXISTS'],
-      table: ['DROP TABLE', 'DROP TABLE IF EXISTS'],
-      snapshotTable: ['DROP SNAPSHOT TABLE', 'DROP SNAPSHOT TABLE IF EXISTS'],
-      externalTable: ['DROP EXTERNAL TABLE', 'DROP EXTERNAL TABLE IF EXISTS'],
       view: ['DROP VIEW', 'DROP VIEW IF EXISTS'],
       materializedViews: ['DROP MATERIALIZED VIEW', 'DROP MATERIALIZED VIEW IF EXISTS'],
       function: ['DROP FUNCTION', 'DROP FUNCTION IF EXISTS'],
diff --git a/test/db2.test.ts b/test/db2.test.ts
index 72aa83bc..dd78c55c 100644
--- a/test/db2.test.ts
+++ b/test/db2.test.ts
@@ -23,6 +23,7 @@ import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
 import supportsMergeInto from './features/mergeInto';
+import supportsCreateView from './features/createView';
 
 describe('Db2Formatter', () => {
   const language = 'db2';
@@ -30,10 +31,15 @@ describe('Db2Formatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
+  supportsCreateView(format, { orReplace: true });
   supportsCreateTable(format);
   supportsDropTable(format);
   supportsConstraints(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format, { whereCurrentOf: true });
@@ -104,4 +110,26 @@ describe('Db2Formatter', () => {
       WITH CS
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(
+      format(
+        `ALTER TABLE t ALTER COLUMN foo SET DATA TYPE VARCHAR;
+         ALTER TABLE t ALTER COLUMN foo SET NOT NULL`
+      )
+    ).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET DATA TYPE
+        VARCHAR;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET NOT NULL
+    `);
+  });
 });
diff --git a/test/features/alterTable.ts b/test/features/alterTable.ts
index b5abbae7..5b45618d 100644
--- a/test/features/alterTable.ts
+++ b/test/features/alterTable.ts
@@ -2,14 +2,72 @@ import dedent from 'dedent-js';
 
 import { FormatFn } from 'src/sqlFormatter';
 
-export default function supportsAlterTable(format: FormatFn) {
-  it('formats ALTER TABLE ... ALTER COLUMN query', () => {
-    const result = format('ALTER TABLE supplier ALTER COLUMN supplier_name VARCHAR(100) NOT NULL;');
-    expect(result).toBe(dedent`
-      ALTER TABLE
-        supplier
-      ALTER COLUMN
-        supplier_name VARCHAR(100) NOT NULL;
-    `);
-  });
+interface AlterTableConfig {
+  addColumn?: boolean;
+  dropColumn?: boolean;
+  modify?: boolean;
+  renameTo?: boolean;
+  renameColumn?: boolean;
+}
+
+export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConfig = {}) {
+  if (cfg.addColumn) {
+    it('formats ALTER TABLE ... ADD COLUMN query', () => {
+      const result = format('ALTER TABLE supplier ADD COLUMN unit_price DECIMAL NOT NULL;');
+      expect(result).toBe(dedent`
+        ALTER TABLE
+          supplier
+        ADD COLUMN
+          unit_price DECIMAL NOT NULL;
+      `);
+    });
+  }
+
+  if (cfg.dropColumn) {
+    it('formats ALTER TABLE ... DROP COLUMN query', () => {
+      const result = format('ALTER TABLE supplier DROP COLUMN unit_price;');
+      expect(result).toBe(dedent`
+        ALTER TABLE
+          supplier
+        DROP COLUMN
+          unit_price;
+      `);
+    });
+  }
+
+  if (cfg.modify) {
+    it('formats ALTER TABLE ... MODIFY statement', () => {
+      const result = format('ALTER TABLE supplier MODIFY supplier_id DECIMAL NULL;');
+      expect(result).toBe(dedent`
+        ALTER TABLE
+          supplier
+        MODIFY
+          supplier_id DECIMAL NULL;
+      `);
+    });
+  }
+
+  if (cfg.renameTo) {
+    it('formats ALTER TABLE ... RENAME TO statement', () => {
+      const result = format('ALTER TABLE supplier RENAME TO the_one_who_supplies;');
+      expect(result).toBe(dedent`
+        ALTER TABLE
+          supplier
+        RENAME TO
+          the_one_who_supplies;
+      `);
+    });
+  }
+
+  if (cfg.renameColumn) {
+    it('formats ALTER TABLE ... RENAME COLUMN statement', () => {
+      const result = format('ALTER TABLE supplier RENAME COLUMN supplier_id TO id;');
+      expect(result).toBe(dedent`
+        ALTER TABLE
+          supplier
+        RENAME COLUMN
+          supplier_id TO id;
+      `);
+    });
+  }
 }
diff --git a/test/features/alterTableModify.ts b/test/features/alterTableModify.ts
deleted file mode 100644
index e648dd50..00000000
--- a/test/features/alterTableModify.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import dedent from 'dedent-js';
-
-import { FormatFn } from 'src/sqlFormatter';
-
-export default function supportsAlterTableModify(format: FormatFn) {
-  it('formats ALTER TABLE ... MODIFY statement', () => {
-    const result = format('ALTER TABLE supplier MODIFY supplier_name char(100) NOT NULL;');
-    expect(result).toBe(dedent`
-      ALTER TABLE
-        supplier
-      MODIFY
-        supplier_name char(100) NOT NULL;
-    `);
-  });
-}
diff --git a/test/features/createTable.ts b/test/features/createTable.ts
index 98a247db..0d097030 100644
--- a/test/features/createTable.ts
+++ b/test/features/createTable.ts
@@ -2,7 +2,15 @@ import dedent from 'dedent-js';
 
 import { FormatFn } from 'src/sqlFormatter';
 
-export default function supportsCreateTable(format: FormatFn) {
+interface CreateTableConfig {
+  orReplace?: boolean;
+  ifNotExists?: boolean;
+}
+
+export default function supportsCreateTable(
+  format: FormatFn,
+  { orReplace, ifNotExists }: CreateTableConfig = {}
+) {
   it('formats short CREATE TABLE', () => {
     expect(format('CREATE TABLE tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent`
       CREATE TABLE
@@ -25,4 +33,22 @@ export default function supportsCreateTable(format: FormatFn) {
         );
     `);
   });
+
+  if (orReplace) {
+    it('formats short CREATE OR REPLACE TABLE', () => {
+      expect(format('CREATE OR REPLACE TABLE tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent`
+        CREATE OR REPLACE TABLE
+          tbl (a INT PRIMARY KEY, b TEXT);
+      `);
+    });
+  }
+
+  if (ifNotExists) {
+    it('formats short CREATE TABLE IF NOT EXISTS', () => {
+      expect(format('CREATE TABLE IF NOT EXISTS tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent`
+        CREATE TABLE IF NOT EXISTS
+          tbl (a INT PRIMARY KEY, b TEXT);
+      `);
+    });
+  }
 }
diff --git a/test/features/createView.ts b/test/features/createView.ts
new file mode 100644
index 00000000..fce33bae
--- /dev/null
+++ b/test/features/createView.ts
@@ -0,0 +1,59 @@
+import dedent from 'dedent-js';
+
+import { FormatFn } from 'src/sqlFormatter';
+
+interface CreateViewConfig {
+  orReplace?: boolean;
+  materialized?: boolean;
+}
+
+export default function supportsCreateView(
+  format: FormatFn,
+  { orReplace, materialized }: CreateViewConfig = {}
+) {
+  it('formats CREATE VIEW', () => {
+    expect(format('CREATE VIEW my_view AS SELECT id, fname, lname FROM tbl;')).toBe(dedent`
+      CREATE VIEW
+        my_view AS
+      SELECT
+        id,
+        fname,
+        lname
+      FROM
+        tbl;
+    `);
+  });
+
+  it('formats CREATE VIEW with columns', () => {
+    expect(format('CREATE VIEW my_view (id, fname, lname) AS SELECT * FROM tbl;')).toBe(dedent`
+      CREATE VIEW
+        my_view (id, fname, lname) AS
+      SELECT
+        *
+      FROM
+        tbl;
+    `);
+  });
+
+  if (orReplace) {
+    it('formats CREATE OR REPLACE VIEW', () => {
+      expect(format('CREATE OR REPLACE VIEW v1 AS SELECT 42;')).toBe(dedent`
+        CREATE OR REPLACE VIEW
+          v1 AS
+        SELECT
+          42;
+      `);
+    });
+  }
+
+  if (materialized) {
+    it('formats CREATE MATERIALIZED VIEW', () => {
+      expect(format('CREATE MATERIALIZED VIEW mat_view AS SELECT 42;')).toBe(dedent`
+        CREATE MATERIALIZED VIEW
+          mat_view AS
+        SELECT
+          42;
+      `);
+    });
+  }
+}
diff --git a/test/features/dropTable.ts b/test/features/dropTable.ts
index fd2cee52..2dee06a7 100644
--- a/test/features/dropTable.ts
+++ b/test/features/dropTable.ts
@@ -2,7 +2,11 @@ import dedent from 'dedent-js';
 
 import { FormatFn } from 'src/sqlFormatter';
 
-export default function supportsDropTable(format: FormatFn) {
+interface DropTableConfig {
+  ifExists?: boolean;
+}
+
+export default function supportsDropTable(format: FormatFn, { ifExists }: DropTableConfig = {}) {
   it('formats DROP TABLE statement', () => {
     const result = format('DROP TABLE admin_role;');
     expect(result).toBe(dedent`
@@ -10,4 +14,14 @@ export default function supportsDropTable(format: FormatFn) {
         admin_role;
     `);
   });
+
+  if (ifExists) {
+    it('formats DROP TABLE IF EXISTS statement', () => {
+      const result = format('DROP TABLE IF EXISTS admin_role;');
+      expect(result).toBe(dedent`
+        DROP TABLE IF EXISTS
+          admin_role;
+      `);
+    });
+  }
 }
diff --git a/test/hive.test.ts b/test/hive.test.ts
index 67759703..d7be517d 100644
--- a/test/hive.test.ts
+++ b/test/hive.test.ts
@@ -23,6 +23,7 @@ import supportsUpdate from './features/update';
 import supportsDeleteFrom from './features/deleteFrom';
 import supportsTruncateTable from './features/truncateTable';
 import supportsMergeInto from './features/mergeInto';
+import supportsCreateView from './features/createView';
 
 describe('HiveFormatter', () => {
   const language = 'hive';
@@ -30,9 +31,10 @@ describe('HiveFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
-  supportsAlterTable(format);
+  supportsCreateView(format, { materialized: true });
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
+  supportsAlterTable(format, { renameTo: true });
   supportsUpdate(format);
   supportsDeleteFrom(format);
   supportsTruncateTable(format, { withoutTable: true });
diff --git a/test/mariadb.test.ts b/test/mariadb.test.ts
index 37e0909b..e2fafae8 100644
--- a/test/mariadb.test.ts
+++ b/test/mariadb.test.ts
@@ -7,6 +7,7 @@ import supportsOperators from './features/operators';
 import supportsReturning from './features/returning';
 import supportsSetOperations, { standardSetOperations } from './features/setOperations';
 import supportsLimiting from './features/limiting';
+import supportsCreateTable from './features/createTable';
 
 describe('MariaDbFormatter', () => {
   const language = 'mariadb';
@@ -22,4 +23,5 @@ describe('MariaDbFormatter', () => {
   supportsOperators(format, MariaDbFormatter.operators, ['AND', 'OR', 'XOR']);
   supportsReturning(format);
   supportsLimiting(format, { limit: true, offset: true, fetchFirst: true, fetchNext: true });
+  supportsCreateTable(format, { orReplace: true, ifNotExists: true });
 });
diff --git a/test/mysql.test.ts b/test/mysql.test.ts
index 8a7cd8c6..c7789a66 100644
--- a/test/mysql.test.ts
+++ b/test/mysql.test.ts
@@ -9,6 +9,7 @@ import supportsOperators from './features/operators';
 import supportsWindow from './features/window';
 import supportsSetOperations from './features/setOperations';
 import supportsLimiting from './features/limiting';
+import supportsCreateTable from './features/createTable';
 
 describe('MySqlFormatter', () => {
   const language = 'mysql';
@@ -24,6 +25,7 @@ describe('MySqlFormatter', () => {
   supportsOperators(format, MySqlFormatter.operators, ['AND', 'OR', 'XOR']);
   supportsWindow(format);
   supportsLimiting(format, { limit: true, offset: true });
+  supportsCreateTable(format, { ifNotExists: true });
 
   // TODO: disabled for now
   it.skip('supports @@ system variables', () => {
diff --git a/test/plsql.test.ts b/test/plsql.test.ts
index a89ed3cc..0875a7f1 100644
--- a/test/plsql.test.ts
+++ b/test/plsql.test.ts
@@ -5,7 +5,6 @@ import PlSqlFormatter from 'src/languages/plsql/plsql.formatter';
 import behavesLikeSqlFormatter from './behavesLikeSqlFormatter';
 
 import supportsAlterTable from './features/alterTable';
-import supportsAlterTableModify from './features/alterTableModify';
 import supportsBetween from './features/between';
 import supportsCreateTable from './features/createTable';
 import supportsDropTable from './features/dropTable';
@@ -25,6 +24,7 @@ import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
 import supportsMergeInto from './features/mergeInto';
+import supportsCreateView from './features/createView';
 
 describe('PlSqlFormatter', () => {
   const language = 'plsql';
@@ -32,11 +32,16 @@ describe('PlSqlFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
+  supportsCreateView(format, { orReplace: true, materialized: true });
   supportsCreateTable(format);
   supportsDropTable(format);
   supportsConstraints(format);
-  supportsAlterTable(format);
-  supportsAlterTableModify(format);
+  supportsAlterTable(format, {
+    dropColumn: true,
+    modify: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format);
diff --git a/test/postgresql.test.ts b/test/postgresql.test.ts
index b67a11f0..68caee62 100644
--- a/test/postgresql.test.ts
+++ b/test/postgresql.test.ts
@@ -25,6 +25,7 @@ import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
 
 describe('PostgreSqlFormatter', () => {
   const language = 'postgresql';
@@ -32,11 +33,17 @@ describe('PostgreSqlFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsCreateView(format, { orReplace: true, materialized: true });
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
   supportsConstraints(format);
   supportsArrayAndMapAccessors(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format, { whereCurrentOf: true });
@@ -117,4 +124,50 @@ describe('PostgreSqlFormatter', () => {
         tbl;
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(
+      format(
+        `ALTER TABLE t ALTER COLUMN foo SET DATA TYPE VARCHAR;
+         ALTER TABLE t ALTER COLUMN foo SET DEFAULT 5;
+         ALTER TABLE t ALTER COLUMN foo DROP DEFAULT;
+         ALTER TABLE t ALTER COLUMN foo SET NOT NULL;
+         ALTER TABLE t ALTER COLUMN foo DROP NOT NULL`
+      )
+    ).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET DATA TYPE
+        VARCHAR;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET DEFAULT
+        5;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      DROP DEFAULT
+      ;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET NOT NULL
+      ;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      DROP NOT NULL
+    `);
+  });
 });
diff --git a/test/redshift.test.ts b/test/redshift.test.ts
index f92e7253..50e5e3ee 100644
--- a/test/redshift.test.ts
+++ b/test/redshift.test.ts
@@ -19,6 +19,7 @@ import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
 
 describe('RedshiftFormatter', () => {
   const language = 'redshift';
@@ -26,9 +27,15 @@ describe('RedshiftFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
-  supportsAlterTable(format);
+  supportsCreateView(format, { orReplace: true, materialized: true });
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format, { withoutFrom: true });
   supportsInsertInto(format);
   supportsUpdate(format);
@@ -122,4 +129,27 @@ describe('RedshiftFormatter', () => {
         AS 'us-east-1'
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(
+      format(
+        `ALTER TABLE t ALTER COLUMN foo TYPE VARCHAR;
+         ALTER TABLE t ALTER COLUMN foo ENCODE my_encoding;`
+      )
+    ).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      TYPE
+        VARCHAR;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      ENCODE
+        my_encoding;
+    `);
+  });
 });
diff --git a/test/spark.test.ts b/test/spark.test.ts
index 0898c469..d1f728af 100644
--- a/test/spark.test.ts
+++ b/test/spark.test.ts
@@ -18,6 +18,7 @@ import supportsSetOperations from './features/setOperations';
 import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
 
 describe('SparkFormatter', () => {
   const language = 'spark';
@@ -25,9 +26,14 @@ describe('SparkFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
-  supportsAlterTable(format);
+  supportsCreateView(format, { orReplace: true });
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
+  supportsAlterTable(format, {
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsInsertInto(format, { withoutInto: true });
   supportsTruncateTable(format);
   supportsStrings(format, ["''", "X''"]);
@@ -121,4 +127,14 @@ describe('SparkFormatter', () => {
         count;
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(format(`ALTER TABLE StudentInfo ALTER COLUMN FirstName COMMENT "new comment";`))
+      .toBe(dedent`
+      ALTER TABLE
+        StudentInfo
+      ALTER COLUMN
+        FirstName COMMENT "new comment";
+    `);
+  });
 });
diff --git a/test/sql.test.ts b/test/sql.test.ts
index abce4330..7781cf36 100644
--- a/test/sql.test.ts
+++ b/test/sql.test.ts
@@ -23,6 +23,7 @@ import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
 
 describe('SqlFormatter', () => {
   const language = 'sql';
@@ -30,10 +31,16 @@ describe('SqlFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
+  supportsCreateView(format);
   supportsCreateTable(format);
   supportsDropTable(format);
   supportsConstraints(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format, { whereCurrentOf: true });
@@ -63,4 +70,43 @@ describe('SqlFormatter', () => {
         { foo };
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(
+      format(
+        `ALTER TABLE t ALTER COLUMN foo SET DEFAULT 5;
+         ALTER TABLE t ALTER COLUMN foo DROP DEFAULT;
+         ALTER TABLE t ALTER COLUMN foo DROP SCOPE CASCADE;
+         ALTER TABLE t ALTER COLUMN foo RESTART WITH 10;`
+      )
+    ).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      SET DEFAULT
+        5;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      DROP DEFAULT
+      ;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      DROP SCOPE CASCADE
+      ;
+
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo
+      RESTART WITH
+        10;
+    `);
+  });
 });
diff --git a/test/sqlite.test.ts b/test/sqlite.test.ts
index 621e411a..a90869ff 100644
--- a/test/sqlite.test.ts
+++ b/test/sqlite.test.ts
@@ -21,6 +21,7 @@ import supportsSetOperations from './features/setOperations';
 import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
+import supportsCreateView from './features/createView';
 
 describe('SqliteFormatter', () => {
   const language = 'sqlite';
@@ -28,10 +29,16 @@ describe('SqliteFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsCreateView(format);
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
   supportsConstraints(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format);
diff --git a/test/trino.test.ts b/test/trino.test.ts
index 6f2917e0..120321e3 100644
--- a/test/trino.test.ts
+++ b/test/trino.test.ts
@@ -22,6 +22,8 @@ import supportsLimiting from './features/limiting';
 import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
+import supportsCreateView from './features/createView';
+import supportsAlterTable from './features/alterTable';
 
 describe('TrinoFormatter', () => {
   const language = 'trino';
@@ -29,8 +31,15 @@ describe('TrinoFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
-  supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsCreateView(format, { orReplace: true, materialized: true });
+  supportsCreateTable(format, { ifNotExists: true });
+  supportsDropTable(format, { ifExists: true });
+  supportsAlterTable(format, {
+    addColumn: true,
+    dropColumn: true,
+    renameTo: true,
+    renameColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format);
   supportsUpdate(format);
@@ -104,34 +113,4 @@ describe('TrinoFormatter', () => {
         )
     `);
   });
-
-  it('formats basic ALTER TABLE statements', () => {
-    const result = format(`
-      ALTER TABLE people RENAME TO persons;
-      ALTER TABLE persons ADD COLUMN location_id INT;
-      ALTER TABLE persons RENAME COLUMN location_id TO loc_id;
-      ALTER TABLE persons DROP COLUMN loc_id;
-    `);
-    expect(result).toBe(dedent`
-      ALTER TABLE
-        people
-      RENAME TO
-        persons;
-
-      ALTER TABLE
-        persons
-      ADD COLUMN
-        location_id INT;
-
-      ALTER TABLE
-        persons
-      RENAME COLUMN
-        location_id TO loc_id;
-
-      ALTER TABLE
-        persons
-      DROP COLUMN
-        loc_id;
-    `);
-  });
 });
diff --git a/test/tsql.test.ts b/test/tsql.test.ts
index 089de14d..34600de2 100644
--- a/test/tsql.test.ts
+++ b/test/tsql.test.ts
@@ -23,6 +23,7 @@ import supportsInsertInto from './features/insertInto';
 import supportsUpdate from './features/update';
 import supportsTruncateTable from './features/truncateTable';
 import supportsMergeInto from './features/mergeInto';
+import supportsCreateView from './features/createView';
 
 describe('TSqlFormatter', () => {
   const language = 'tsql';
@@ -30,10 +31,13 @@ describe('TSqlFormatter', () => {
 
   behavesLikeSqlFormatter(format);
   supportsComments(format);
+  supportsCreateView(format, { materialized: true });
   supportsCreateTable(format);
-  supportsDropTable(format);
+  supportsDropTable(format, { ifExists: true });
   supportsConstraints(format);
-  supportsAlterTable(format);
+  supportsAlterTable(format, {
+    dropColumn: true,
+  });
   supportsDeleteFrom(format);
   supportsInsertInto(format, { withoutInto: true });
   supportsUpdate(format, { whereCurrentOf: true });
@@ -90,4 +94,13 @@ describe('TSqlFormatter', () => {
         tbl;
     `);
   });
+
+  it('formats ALTER TABLE ... ALTER COLUMN', () => {
+    expect(format(`ALTER TABLE t ALTER COLUMN foo INT NOT NULL DEFAULT 5;`)).toBe(dedent`
+      ALTER TABLE
+        t
+      ALTER COLUMN
+        foo INT NOT NULL DEFAULT 5;
+    `);
+  });
 });