Summary of Commands

Snowflake supports most of the commands defined in SQL:1999.

In this Topic:

DDL (Data Definition Language)

Account-based and Session-based DDL

Category Commands Notes
Account ALTER Used to set account-level parameters (only by users with ACCOUNTADMIN role).
Session ALTER , USE { DATABASE | ROLE | SCHEMA | WAREHOUSE } The USE command sets the database, role, schema, or warehouse for the current session.
Parameters SHOW Used to view parameters settings for the account or current session.
Functions SHOW Displays both system-defined functions and UDFs.
SQL Variables SET , SHOW , UNSET Used to set SQL variables in the current session.

Account Object DDL

Object Type Commands Notes
Roles ALTER , CREATE , DESC , DROP , SHOW , USE  
Users ALTER , CREATE , DESC , DROP , SHOW  
Privileges GRANT , REVOKE , SHOW Privileges are not strictly a first-class object; however, these commands are used for enabling and managing access control for all first-class objects in Snowflake.
Resource Monitors ALTER , CREATE , DESC , DROP , SHOW  
Virtual Warehouses ALTER , CREATE , DESC , DROP , SHOW , USE  
Shares ALTER , CREATE , DESC , DROP , SHOW  
Databases ALTER , CREATE , DESC , DROP , SHOW , UNDROP , USE CREATE also supports cloning existing databases.
N/A COMMENT This command can be used with any account object; also, comments be set using CREATE or ALTER.

Database and Schema Object DDL

Object Type Commands Notes
Schemas ALTER , CREATE , DESC , DROP , SHOW , UNDROP , USE CREATE also supports cloning existing schemas.
Tables ALTER , CREATE , DESC , DROP , SHOW , TRUNCATE , UNDROP CREATE also supports cloning existing tables, creating populated tables (using CTAS), and creating empty tables (from existing tables).
Views ALTER , CREATE , DESC , DROP , SHOW  
Stages ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing named stages (external only).
File Formats ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing file formats.
Pipes ALTER , CREATE , DESC , DROP , SHOW  
User-Defined Functions ALTER , CREATE , DESC , DROP , SHOW Used for creating and managing UDFs.
Sequences ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing sequences.
N/A COMMENT This command can be used with any database/schema object; also, comments be set using CREATE or ALTER.

DML (Data Manipulation Language)

Category Commands Notes
General DELETE , INSERT , MERGE , REPLACE , UPDATE INSERT includes support for multi-table inserts.
Queries SELECT  
Transactions BEGIN , COMMIT , ROLLBACK , SHOW , SHOW LOCKS Used to support multi-statement transactions in Snowflake.
Data Loading (i.e. bulk import) COPY INTO <table>  
Data Unloading (i.e. bulk export) COPY INTO <location>  
File Staging GET , LIST , PUT , REMOVE These commands do not perform DML; they are used to stage and manage files for data loading and unloading DML.

Query Constructs

Category Constructs Notes
Query Syntax [ WITH ]  
SELECT [ DISTINCT ] Required.
[ FROM ]  
[ AT | BEFORE ]
For querying using Time Travel.
[ SAMPLE ] / [ TABLESAMPLE ]
TABLESAMPLE is a synonym for SAMPLE.
[ JOIN ]
Support for inner, left outer, right outer, and full joins.
[ PIVOT | UNPIVOT ]
 
[ WHERE ]  
[ GROUP BY ] Columns used in GROUP BY must be in SELECT list.
[ HAVING ]
 
[ ORDER BY ]  
[ VALUES ]  
[ LIMIT ]  
Query Operators INTERSECT [ ALL ]  
MINUS [ ALL ] / EXCEPT  
UNION [ ALL ]  
Predicates BETWEEN  
[ NOT ] IN  
[ NOT ] EXISTS  
LIKE