Recall & Review
beginner
What is a view in a database?
A view is like a saved query that looks like a table. It shows data from one or more tables but does not store data itself.
Click to reveal answer
beginner
How do you select data from a view named
employee_view?You use a SELECT statement just like with a table: <br>
SELECT * FROM employee_view;Click to reveal answer
intermediate
Can you update data directly through a view?
Sometimes yes, if the view is simple and based on one table. But complex views or those with joins usually cannot be updated directly.
Click to reveal answer
beginner
Why use views instead of querying tables directly?
Views simplify complex queries, hide sensitive columns, and provide a consistent way to look at data.
Click to reveal answer
beginner
Write a simple SQL to create a view named
active_customers showing customers with status 'active'.CREATE VIEW active_customers AS
SELECT * FROM customers WHERE status = 'active';
Click to reveal answer
What does a view in SQL represent?
✗ Incorrect
A view is a saved query that behaves like a table but does not store data itself.
Which SQL command is used to get data from a view named
sales_view?✗ Incorrect
You use SELECT to query data from a view just like a table.
Can you always update data through a view?
✗ Incorrect
Updates through views are allowed only if the view is simple and based on a single table.
Why might you use a view instead of querying tables directly?
✗ Incorrect
Views help simplify queries and can hide sensitive columns from users.
Which of these is the correct syntax to create a view?
✗ Incorrect
The correct syntax to create a view is CREATE VIEW view_name AS SELECT ...
Explain what a database view is and why it is useful.
Think about how a view acts like a window to data.
You got /4 concepts.
Describe how to query data from a view and mention any limitations on updating data through views.
Consider how views behave like tables but with some restrictions.
You got /4 concepts.