Summary of Commands

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

In this Topic:

Data Definition Language (DDL) Commands

Account and Session-based DDL

Category Commands Notes
Account ALTER Used to set account-level parameters (only for users with ACCOUNTADMIN role).
Session ALTER , USE ROLE | WAREHOUSE | DATABASE | SCHEMA  
Parameters SHOW Used to view parameters settings for the account or session.
Functions SHOW Displays both system-defined functions and UDFs.
SQL Variables SET , UNSET , SHOW  
Transactions BEGIN , COMMIT , ROLLBACK , SHOW , SHOW LOCKS Used for multi-statement transactions.

Object-based DDL

Category Commands Notes
All Objects COMMENT Comments can also be set using CREATE or ALTER for any object.
Roles ALTER , CREATE , DESC , DROP , SHOW , USE  
Users ALTER , CREATE , DESC , DROP , SHOW  
Privileges GRANT , REVOKE , SHOW Used for enabling and managing access control for objects.
Resource Monitors ALTER , CREATE , DESC , DROP , SHOW  
Virtual Warehouses ALTER , CREATE , DESC , DROP , SHOW , USE  
Databases ALTER , CREATE , DESC , DROP , SHOW , USE , UNDROP CREATE also supports cloning existing databases.
Schemas ALTER , CREATE , DESC , DROP , SHOW , USE , UNDROP CREATE also supports cloning existing schemas.
Shares ALTER , CREATE , DESC , DROP , SHOW  
Tables ALTER , CREATE , DESC , DROP , SHOW , TRUNCATE , UNDROP CREATE also supports cloning existing tables, using CTAS to create populated tables, and creating empty tables from existing tables.
Views ALTER , CREATE , DESC , DROP , SHOW  
Sequences ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing sequences.
File Formats ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing file formats.
Stages ALTER , CREATE , DESC , DROP , SHOW CREATE also supports cloning existing stages (external stages only).
User-Defined Functions ALTER , CREATE , DESC , DROP , SHOW Used for creating and managing UDFs.

Data Manipulation Language (DML) Commands

Category Commands Notes
General DELETE , INSERT , MERGE , REPLACE , UPDATE INSERT includes support for multi-table inserts.
Data Import (Loading) COPY INTO table  
Data Export (Unloading) COPY INTO location  
File Staging PUT , GET , LIST , REMOVE These commands do not perform DML; they are used to upload/download and manage files staged for data loading and unloading.

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.
[ 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