0
0
SQLquery~5 mins

View as a saved query mental model in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a SQL view?
A SQL view is like a saved query. It shows data from one or more tables but does not store data itself. It acts like a virtual table.
Click to reveal answer
beginner
How does a view help simplify complex queries?
A view saves a complex query so you can use it easily later. You just select from the view instead of writing the full query again.
Click to reveal answer
intermediate
Can you update data through a view?
Sometimes yes, if the view is simple and directly maps to one table. But if the view joins many tables or uses aggregation, updates usually are not allowed.
Click to reveal answer
beginner
What happens when you query a view?
The database runs the saved query behind the view and shows the results as if it was a table.
Click to reveal answer
beginner
Why use views instead of tables?
Views help keep data safe by hiding columns or rows. They also make queries easier and keep your database organized.
Click to reveal answer
What does a SQL view store?
AThe result of a query as data
BA saved query definition
CA backup of a table
DIndexes for faster search
Which of these is true about views?
AViews can simplify complex queries
BViews are the same as tables
CViews cannot be used in SELECT statements
DViews always store data physically
Can you update data through any view?
AYes, all views allow updates
BNo, views never allow updates
COnly simple views that map to one table allow updates
DOnly views with joins allow updates
What is the main benefit of using a view?
ATo speed up data entry
BTo store large amounts of data
CTo create backups of tables
DTo hide complex queries and simplify access
When you select from a view, what happens?
AThe database runs the saved query behind the view
BThe view data is copied to a new table
CThe view data is deleted
DNothing happens, views cannot be selected
Explain what a SQL view is and how it works as a saved query.
Think of a view as a shortcut to a query.
You got /4 concepts.
    Describe the benefits and limitations of using views in a database.
    Consider both what views help with and what they cannot do.
    You got /4 concepts.