Views
Altertable catalog views are defined with standard CREATE VIEW syntax and stored in catalog metadata. They provide a stable name over a query so dashboards, agents, and downstream SQL can reference a logical table without repeating the underlying statement.
Run the statements below through Altertable's SQL engine against an Altertable catalog you own.
Create a view
CREATE VIEW my_catalog.main.open_purchase_orders ASSELECT po_id, vendor_id, amount, submitted_atFROM my_catalog.main.purchase_ordersWHERE status IN ('draft', 'submitted');
Views can reference other views and tables in the same catalog. Altertable resolves the view definition at query time using the current catalog state.
Drop a view
DROP VIEW my_catalog.main.open_purchase_orders;
When to use views
Use views to encapsulate common filters, joins, or column projections that many queries share. They keep consumer SQL stable when underlying table layouts evolve, as long as the view definition is updated to preserve the expected columns.
Views do not store data — they are query definitions only. For materialized results that persist between queries, write to a table instead.
Learn more
- Altertable Catalogs: Create and manage managed catalogs
- Macros: Reusable scalar and table expressions
- SQL Engine: DuckDB dialect and federated queries