Views

A view is a named query stored in the database, which you query like a table. It simplifies complex queries, centralizes logic and can restrict access to certain columns. An ordinary view does not store data: it runs its query on every read.

Example

CREATE VIEW ca_par_client AS
SELECT client_id, SUM(total) AS ca FROM commandes GROUP BY client_id;

Related concepts

The whole glossary