Lesson 27 of 30
90%
Views
A view is a saved SELECT with a name.
It looks like a table when you read it. It does not copy the data.
Think of a saved camera angle on the same room.
Create a view
sql
Result
Query OK, 0 rows affected
Use it
sql
Result
| name | points |
|---|---|
| Ada | 95 |
| Sam | 90 |
2 rows
Why views help
1
Hide a long join behind a short name
2
Give each team a safe slice of the data
3
Keep one definition, many readers
Replace or drop
sql
Result
Query OK, 0 rows affected
Query OK, 0 rows affected
Tip: Views are for reading. Put new rows in the real tables.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.