SQL reference for Databricks SQL
Preview
This feature is in Public Preview.
This is a SQL command reference for Databricks SQL.
General reference
This general reference describes data types, functions, identifiers, literals, and semantics:
- How to read a syntax diagram
- Configuration parameters
- Data types and literals
- SQL data type rules
- Datetime patterns
- Built-in functions
- Lambda functions
- Window functions
- Identifiers
- Names
- Null semantics
- Expressions
- JSON path expressions
- Partitions
- Principals
- Privileges and securable objects
- External locations and storage credentials
- Reserved words
DDL statements
You use data definition statements to create or modify the structure of database objects in a database:
- ALTER CATALOG
- ALTER CREDENTIAL
- ALTER DATABASE
- ALTER LOCATION
- ALTER TABLE
- ALTER SCHEMA
- ALTER SHARE
- ALTER VIEW
- COMMENT ON
- CREATE BLOOMFILTER INDEX
- CREATE DATABASE
- CREATE FUNCTION (SQL)
- CREATE LOCATION
- CREATE SCHEMA
- CREATE TABLE (Databricks SQL)
- CREATE VIEW
- DROP BLOOMFILTER INDEX
- DROP CATALOG
- DROP DATABASE
- DROP CREDENTIAL
- DROP FUNCTION
- DROP LOCATION
- DROP RECIPIENT
- DROP SCHEMA
- DROP SHARE
- DROP TABLE
- DROP VIEW
- MSCK REPAIR TABLE
- TRUNCATE TABLE
DML statements
You use data manipulation statements to add, change, or delete data from a Delta Lake table:
Data retrieval statements
You use a query to retrieve rows from one or more tables according to the specified clauses. The full syntax
and brief description of supported clauses are explained in the Query article.
The related SQL statements SELECT
and VALUES
are also included in this section.
Databricks SQL also provides the ability to generate the logical and physical plan for a query using the EXPLAIN
statement.
Delta Lake statements
You use Delta Lake SQL statements to manage tables stored in Delta Lake format:
For details on using Delta Lake statements, see Delta Lake guide.
Auxiliary statements
You use auxiliary statements to collect statistics, manage caching, explore metadata, set configurations, and manage resources:
Security statements
You use security SQL statements to manage access to data:
For details using these statements, see Data object privileges.