# Database View

> A saved query you can read from as if it were a table.

**Field:** Software Development  
**Category:** Databases  
**Also known as:** SQL View, View

## Think of it like

Think of it like a window that only shows part of a garden. The garden is the same, you just see less.

## Definition

A database view is a saved query that you can use as if it were a table. It stores no data of its own. Each time you read from it, the database runs the query behind it. Views hide hard joins behind a simple name, and they can show some columns while hiding others. You read from a view with SELECT, just like a table.

## Example

Lucy's team keeps asking for this month's paid orders. She saves the query as a view called paid_orders, and everyone uses that.

## Example code

```sql
CREATE VIEW rich AS
SELECT name FROM accounts WHERE balance > 60;
SELECT * FROM rich;
-- Emma
```

The view runs its saved query every time it is read.

## Why it matters

Views let people use a hard query without writing it. They can also hide private columns.

## Common mistake

Expecting a view to be fast because it looks like a table. It runs its whole query every time.

## Three principles

- **A saved query.** It holds no data itself.
- **Reads like a table.** SELECT works the same way.
- **Hides the hard part.** Joins sit behind one name.

## Related terms

- [Database Query](https://learn.benibix.com/term/development/query)
- [Database Table](https://learn.benibix.com/term/development/database-table)
- [SQL Join](https://learn.benibix.com/term/development/join)
- [Structured Query Language (SQL)](https://learn.benibix.com/term/development/sql)

## Told apart from

- [Database View vs Database Table](https://learn.benibix.com/compare/database-view-vs-database-table): People think a view is a copy of a table, and it is not. A table holds rows of its own on disk. A view holds no rows at all. It is a saved query with a name, and it runs fresh each time you read it. Change a row in the table, and the view shows the change at once.

---

Source: https://learn.benibix.com/term/development/database-view
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
