Reference¶
SQL syntax reference for all DuckDB Semantic Views statements and functions.
DDL statements
CREATE SEMANTIC VIEW — Create a new semantic view with tables, relationships, dimensions, metrics, and facts.
ALTER SEMANTIC VIEW — Rename an existing semantic view.
DROP SEMANTIC VIEW — Remove a semantic view from the catalog.
DESCRIBE SEMANTIC VIEW — Inspect the full definition of a semantic view.
SHOW SEMANTIC VIEWS — List all registered semantic views with optional filtering.
SHOW SEMANTIC DIMENSIONS — List dimensions across one or all semantic views.
SHOW SEMANTIC METRICS — List metrics across one or all semantic views.
SHOW SEMANTIC FACTS — List facts across one or all semantic views.
SHOW SEMANTIC DIMENSIONS FOR METRIC — List dimensions safe to use with a specific metric (fan trap aware).
Query functions
semantic_view() — Query a semantic view with any combination of dimensions and metrics.
explain_semantic_view() — Inspect the SQL generated for a semantic view query.
Error reference
Error Messages — Error messages, causes, and fixes.