SQL Interview Question

What is a view in SQL?

Updated 2026-07-10 · Beginner friendly
Quick answer

A view is a saved query that behaves like a virtual table. It does not store data itself but shows the result of its underlying query whenever you use it. Views help by simplifying complex queries, giving a consistent interface, and hiding sensitive columns from certain users.

Why views are useful

CREATE VIEW active_customers AS
SELECT id, name FROM customers WHERE active = 1;

SELECT * FROM active_customers;  -- query it like a table

Because a view runs its query each time, its data is always current with the underlying tables, though this also means it does not speed up the query by itself.

In the interview

If asked about performance, note that a normal view does not store data, so it does not speed queries up. Mentioning materialised views, which do store results for speed, shows deeper knowledge.

Want the full SQL guide?

Read every SQL concept with notes, diagrams, and code in one place. Track your progress as you go.

Open the SQL guide All SQL questions