SQL reference for Databricks Runtime 7.3 LTS and above
This is a SQL command reference for users on clusters running Databricks Runtime 7.x and above in the Databricks Data Science & Engineering workspace and Databricks Machine Learning environment.
Note
- For Databricks Runtime 5.5 LTS and 6.x SQL commands, see SQL reference for Databricks Runtime 5.5 LTS and 6.x.
- For the Databricks SQL language reference, see SQL reference for Databricks SQL.
General reference
This general reference describes data types, functions, identifiers, literals, and semantics:
- How to read a syntax diagram
- Data types and literals
- SQL data type rules
- Datetime patterns
- Functions
- Built-in functions
- Lambda functions
- Window functions
- Identifiers
- Names
- Null semantics
- Expressions
- JSON path expressions
- Partitions
- ANSI compliance
- Apache Hive compatibility
- Principals
- Privileges and securable objects
- External locations and storage credentials
- Delta Sharing
- Information schema
- 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 CATALOG
- CREATE DATABASE
- CREATE FUNCTION (External)
- CREATE FUNCTION (SQL)
- CREATE LOCATION
- CREATE RECIPIENT
- CREATE SCHEMA
- CREATE SHARE
- CREATE TABLE
- 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:
- COPY INTO
- DELETE FROM
- INSERT INTO
- INSERT OVERWRITE DIRECTORY
- INSERT OVERWRITE DIRECTORY with Hive format
- LOAD DATA
- MERGE INTO
- UPDATE
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 Runtime 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:
- CACHE SELECT
- CONVERT TO DELTA
- DESCRIBE HISTORY
- FSCK REPAIR TABLE
- OPTIMIZE
- REORG TABLE
- RESTORE
- VACUUM
For details on using Delta Lake statements, see Delta Lake guide.
Auxiliary statements
You use auxiliary statements to collect statistics, manage caching for Apache Spark cache, explore metadata, set configurations, and manage resources:
- Analyze statement
- Apache Spark Cache statements
- Describe statements
- Show statements
- Configuration management
- Resource management
Analyze statement
Apache Spark Cache statements
Describe statements
- DESCRIBE CATALOG
- DESCRIBE CREDENTIAL
- DESCRIBE DATABASE
- DESCRIBE FUNCTION
- DESCRIBE LOCATION
- DESCRIBE QUERY
- DESCRIBE RECIPIENT
- DESCRIBE SCHEMA
- DESCRIBE SHARE
- DESCRIBE TABLE
Show statements
- LIST
- SHOW ALL IN SHARE
- SHOW CATALOGS
- SHOW COLUMNS
- SHOW CREATE TABLE
- SHOW CREDENTIALS
- SHOW DATABASES
- SHOW FUNCTIONS
- SHOW GROUPS
- SHOW LOCATIONS
- SHOW PARTITIONS
- SHOW RECIPIENTS
- SHOW SCHEMAS
- SHOW SHARES
- SHOW TABLE
- SHOW TABLES
- SHOW TBLPROPERTIES
- SHOW USERS
- SHOW VIEWS
Configuration management
Resource management
Security statements
You use security SQL statements to manage access to data:
- ALTER GROUP
- CREATE GROUP
- DENY
- DROP GROUP
- GRANT
- GRANT SHARE
- REPAIR PRIVILEGES
- REVOKE
- REVOKE SHARE
- SHOW GRANTS
- SHOW GRANTS ON SHARE
- SHOW GRANTS TO RECIPIENT
For details using these statements, see Data object privileges.
Feedback
Submit and view feedback for