CREATE TABLE
Defines a table in an existing schema.
You can use any of the following different means to create a table for different purposes:
-
Applies to: Databricks SQL Databricks Runtime
Use this syntax if the new table will be:
- Based on a column definition you provide.
- Derived from data at an existing storage location.
- Derived from a query.
-
Applies to: Databricks Runtime
This statement matches CREATE TABLE [USING] using Hive syntax.
CREATE TABLE [USING] is preferred.
-
Applies to: Databricks SQL Databricks Runtime
Using this syntax you create a new table based on the definition, but not the data, of another table.
-
Applies to: Databricks SQL Databricks Runtime
You can use table cloning for Delta Lake tables to achieve two major goals:
- Make a complete, independent copy of a table including its definition and data at a specific version. This is called a
DEEP CLONE
. - Make a copy of the definition of the table which refers to the original table's storage for the initial data at a specific version. Updates, on either the source or the new table will not affect the other. However the new table depends on the source table's existence and column definition.
- Make a complete, independent copy of a table including its definition and data at a specific version. This is called a