Lesson 24 — Views
Views: save a query under a name
A view is a saved SELECT that behaves like a read-only table. You write the complex query once — joins, grouping — and afterwards everyone can simply SELECT from the view. The data is not copied: the view runs its query each time, so it is always up to date.
CREATE VIEW big_orders AS SELECT * FROM orders WHERE total > 100
SELECT * FROM big_orders
Why it matters: views give analysts and apps a simple, stable "table" while the messy details stay in one place.
Write CREATE VIEW customer_totals AS followed by the given SELECT. The view then stays up to date after a new order.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based Databases & SQL courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for Databases & SQL books — check the publication year so the examples match current versions.
Search Amazon →