> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL reference

> Look up Unified SQL syntax, types, functions, and statement behavior. SQL examples can be copied into your Unified SQL client.

ReferenceApplies to: Unified engine deployments

Look up Unified SQL syntax, types, functions, and statement behavior. SQL examples can be copied into your Unified SQL client.

Examples use `demo.tpcds` for sample tables and `demo.examples` for the write lab.
Replace these names with your catalog and namespace.

## Run an example

Copy the SQL into Workbench or a compatible SQL client. Examples that use sample tables need a TPC-DS SF1 dataset. Replace `demo.tpcds` with your source catalog and namespace, and `demo.examples` with a private writable namespace. See [Example data](https://docs.e6data.com/transformation/sql/example-data.md) for the table schema and write-lab requirements.

Run related statements in order in the same session. Queries with inline data do not need a sample dataset.

## Find a topic

| Topic | Reference |
| - | - |
| Dialect, identifiers, and statement rules | [SQL overview](https://docs.e6data.com/transformation/sql/overview.md) |
| Dataset, joins, and write lab | [Example data](https://docs.e6data.com/transformation/sql/example-data.md) |
| SELECT, projection, filtering, and ordering | [Queries](https://docs.e6data.com/transformation/sql/queries.md) |
| Inner, outer, semi, anti, and cross joins | [Joins](https://docs.e6data.com/transformation/sql/joins.md) |
| Grouping, HAVING, ROLLUP, and aggregates | [Aggregations](https://docs.e6data.com/transformation/sql/aggregations.md) |
| CTEs and subqueries | [CTEs and subqueries](https://docs.e6data.com/transformation/sql/subqueries.md) |
| UNION, INTERSECT, and EXCEPT | [Set operations](https://docs.e6data.com/transformation/sql/set-operations.md) |
| PARTITION BY, ordering, and frames | [Window queries](https://docs.e6data.com/transformation/sql/windows.md) |
| Types, casts, and nested values | [Types and expressions](https://docs.e6data.com/transformation/sql/expressions.md) |
| Comparisons, logic, arithmetic, and NULL | [Operators and nulls](https://docs.e6data.com/transformation/sql/operators.md) |
| Registered function inventory | [Functions](https://docs.e6data.com/transformation/sql/functions.md) |
| CREATE, ALTER, DROP, SHOW, and DESCRIBE | [Statements](https://docs.e6data.com/transformation/sql/statements.md) |
| INSERT, overwrite, UPDATE, DELETE, MERGE | [Writing data](https://docs.e6data.com/transformation/sql/writes.md) |
| Maintenance procedures | [Maintenance](https://docs.e6data.com/transformation/sql/maintenance.md) |

## Try the data

This reads ten items from Hub's SF1 dataset. Replace the qualified name with your catalog and dataset namespace.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT i_item_sk, i_item_id, i_category, i_current_price
FROM demo.tpcds.item
ORDER BY i_item_sk
LIMIT 10;
```

The examples teach SQL using TPC-DS data. They are not certified TPC-DS benchmark queries or performance measurements.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.