Views
◈ 2 cardsSave a query under a name and reuse it like a table.
A saved query
A view is a stored SELECT you can query like a table. It doesn't copy data — it runs underneath each time — so it's always live. Views tame complexity and give callers a clean, stable interface:
CREATE VIEW in_stock AS
SELECT title, genre, stock FROM books WHERE stock > 0;
SELECT * FROM in_stock WHERE genre = 'science';
Drop with DROP VIEW. Use views to hide a gnarly join behind a friendly name, or to expose only certain columns.