Define a named virtual table based on a SELECT query.
Saved queries that behave like virtual tables, encapsulating complex logic and simplifying access control. Views can be nested (view on view), and some support updatability. Security views are powerful for column-level access control.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | Standard views supported. No materialized views. |
| PostgreSQL | ✓ Supported | all | Standard views + MATERIALIZED VIEW (since 9.3) with REFRESH MATERIALIZED VIEW [CONCURRENTLY] (since 9.4). |
| SQL Server | ✓ Supported | all | Standard views + indexed views (CREATE UNIQUE CLUSTERED INDEX on a view materializes it, similar to a materialized view). |
| Oracle | ✓ Supported | all | Standard views + MATERIALIZED VIEW (predates PostgreSQL's). Supports ON COMMIT REFRESH and ON DEMAND REFRESH. |
| SQLite | ✓ Supported | all | Views are read-only. INSERT/UPDATE/DELETE through a view requires an INSTEAD OF trigger. |
PostgreSQL and Oracle support true MATERIALIZED VIEWs (pre-computed, stored on disk). SQLite views are read-only. SQL Server achieves materialization via indexed views.
Standard views supported. No materialized views.
Standard views + MATERIALIZED VIEW (since 9.3) with REFRESH MATERIALIZED VIEW [CONCURRENTLY] (since 9.4).
Standard views + indexed views (CREATE UNIQUE CLUSTERED INDEX on a view materializes it, similar to a materialized view).
Standard views + MATERIALIZED VIEW (predates PostgreSQL's). Supports ON COMMIT REFRESH and ON DEMAND REFRESH.
Views are read-only. INSERT/UPDATE/DELETE through a view requires an INSTEAD OF trigger.