Glossary · Database

View

A virtual table based on a stored SQL query that presents data from one or more tables in a specific format.

A database view is a virtual table defined by a SQL query. Unlike physical tables, views do not store data themselves–they dynamically execute their underlying query each time they are accessed. Views simplify complex queries by encapsulating joins, filters, and aggregations into a simple table-like interface. They also enhance security by exposing only specific columns or filtered rows to certain users. Materialized views are a special type that cache the query results and must be periodically refreshed, offering better read performance at the cost of freshness. Views are commonly used for reporting, access control, and API abstraction layers.

In practice

How AI for Database applies it

AI for Database treats views as first-class data sources, querying them alongside regular tables for comprehensive results.
Database · aifordatabase glossaryRead-only ✓

Fig — every answer ships with the tables, rows and SQL behind it.

See it on your own database

Connect read-only in minutes. Free models included.

Start free