Documentation
SQL Engine

SQL Engine

Dialect

Altertable uses the DuckDB SQL dialect for all queries. If you are familiar with PostgreSQL or SQLite, most core syntax will be familiar.

Example query when Product Analytics is enabled for the environment:

SELECT
distinct_id,
COUNT(*) AS sessions
FROM product_analytics.analytics.web_sessions
WHERE started_at >= date_trunc('week', now())
GROUP BY distinct_id
ORDER BY sessions DESC
LIMIT 10;

For complete syntax reference, see the DuckDB SQL Documentation.

Data Types

Altertable supports the same data types as DuckDB, including:

  • Numeric types: INTEGER, BIGINT, DOUBLE, DECIMAL, HUGEINT
  • Text types: VARCHAR, TEXT
  • Temporal types: DATE, TIMESTAMP, TIMESTAMPTZ, TIME, INTERVAL
  • Binary types: BLOB, BITSTRING
  • Boolean type: BOOLEAN
  • Nested types: ARRAY, LIST, MAP, STRUCT, UNION
  • Special types: UUID, JSON

For a complete list of supported data types and their specifications, see the DuckDB Data Types Overview.

Federated Queries

Connect multiple data sources, from BigQuery to Postgres catalogs, in the same SQL namespace:

SELECT
u.email,
b.total_revenue
FROM pg_production.users u
JOIN bigquery.revenue b
ON u.id = b.user_id;

The engine handles cross-catalog federation automatically, optimizing query execution across all data sources in your lakehouse.

Crafted with <3 by former Algolia × Front × Sorare builders© 2026 AltertableTermsPrivacySecurityCookies