CREATE Command Reference

Description

Creates various database objects in Singdata Lakehouse.

Syntax

CREATE <object_type> [ IF NOT EXISTS ] <object_name> [ COMMENT '<string_literal>' ]

Parameters

ParameterDescriptionRequired
<object_type>The type of object to create, such as TABLE, VIEW, SCHEMA, etc.Yes
IF NOT EXISTSSilently skip if the object already exists, no errorNo
<object_name>The object name, may include a schema prefixYes
COMMENTObject description/commentNo

Supported Object Types

Object TypeSyntax ExampleDescription
Regular TableCREATE TABLE <name> (col1 TYPE, ...)Structured two-dimensional data
External TableCREATE EXTERNAL TABLE <name> USING <format>Data stored in external systems
ViewCREATE VIEW <name> AS SELECT ...Virtual table, does not store data
Dynamic TableCREATE DYNAMIC TABLE <name> REFRESH INTERVAL ...Data object with automatic incremental refresh
Materialized ViewCREATE MATERIALIZED VIEW <name> AS SELECT ...Pre-computed query results
Table StreamCREATE TABLE STREAM <name> ON TABLE <table>Captures table-level changes (CDC)
SchemaCREATE SCHEMA <name>Namespace
External SchemaCREATE EXTERNAL SCHEMA <name> CONNECTION <conn>Mount an external Schema
External CatalogCREATE EXTERNAL CATALOG <name> CONNECTION <conn>Mount an external catalog
ConnectionCREATE STORAGE/CATALOG/API CONNECTION <name> ...Storage/catalog/API connection configuration
PipeCREATE PIPE <name> ... AS COPY INTO ...Continuous data ingestion pipeline
Compute ClusterCREATE VCLUSTER <name> ...Virtual compute cluster
Data ShareCREATE SHARE <name>Cross-instance data sharing
SynonymCREATE SYNONYM <name> FOR <object>Object alias
SQL FunctionCREATE SQL FUNCTION <name> AS ...User-defined SQL function
External FunctionCREATE EXTERNAL FUNCTION <name> ...Function that invokes external services
UserCREATE USER <name> ...System user
RoleCREATE ROLE <name>Permission role

Required Permissions

Executing CREATE operations requires the corresponding creation permission (such as CREATE TABLE, CREATE VIEW, etc.) on the target Schema or workspace. See the syntax documentation for each object type for specific permission requirements.

Notes

  • Most CREATE statements support the IF NOT EXISTS clause, suitable for use in scripts or automated workflows.
  • You can attach a description using the COMMENT clause when creating an object.
  • Different object types have their own required and optional parameters; see the syntax reference below for details.

Syntax Reference

Data Objects

Indexes and Synonyms

Schema and Catalog

Connections and Pipes

Compute and Sharing

Functions

Users and Permissions