# SQL

SQL is the primary interface for DeltaStream. Using a simple and familiar SQL interface, you can

* create databases
* run continuous queries
* build materialized views
* and more

DeltaStream also provides SQL extensions that enable you to express streaming concepts that don’t have equivalents in traditional SQL.

## DDL

SQL DDLs are queries that create, delete, or modify database structures. Unlike queries, DDLs do not process data. Examples of useful DDLs include:

* [creating databases](https://docs.deltastream.io/reference/sql-syntax/ddl/create-database)
* [creating streams](https://docs.deltastream.io/reference/sql-syntax/ddl/create-stream)
* [dropping entities](https://docs.deltastream.io/reference/sql-syntax/ddl/drop-entity)
* [updating stores](https://docs.deltastream.io/reference/sql-syntax/ddl/update-store)

DDLs are useful in both the DeltaStream UI and the CLI. However, the UI also provides an interface for many of these DDLs, such as creating [stores](https://docs.deltastream.io/overview/core-concepts/store).

For a full list of SQL DDLs, go to [the DDL page](https://docs.deltastream.io/reference/sql-syntax/ddl) of the [SQL Syntax](https://docs.deltastream.io/reference/sql-syntax) section.

## Query

There are two main types of SQL queries that do process data:

1. [Streaming or continuous queries](https://docs.deltastream.io/overview/queries#_streaming_or_continuous_query)
2. [Materialized view queries](https://docs.deltastream.io/overview/queries#query-on-materialized-views)

See more about both in the [Query](https://docs.deltastream.io/overview/core-concepts/queries) page under [Core Concepts](https://docs.deltastream.io/overview/core-concepts).

When you write streaming queries in the UI, successful queries display in the **Query** tab. Interactive streaming queries and queries on materialized views both print results on the page. Similarly, for the CLI you can list successful streaming queries with the [LIST QUERIES](https://docs.deltastream.io/reference/sql-syntax/command/list-queries) command; interactive streaming queries and queries on materialized views in this case print results directly in the console.

For a full list of SQL queries, go to the [Query](https://docs.deltastream.io/reference/sql-syntax/query) section under [SQL Syntax](https://docs.deltastream.io/reference/sql-syntax).

## Command

SQL commands are actions that do not change database entities and do not process data. Examples of useful commands include:

* listing and describing DeltaStream entities
* inviting users to your organization
* granting privileges
* printing the records in [entities](https://docs.deltastream.io/overview/store#entity)

SQL commands are useful when using the CLI. DeltaStream provides the functionality of these commands through its UI.

For a full list of SQL commands, go to the [Commands](https://docs.deltastream.io/reference/sql-syntax/command) section under [SQL Syntax](https://docs.deltastream.io/reference/sql-syntax).
