Recall & Review
beginner
What is a view in a database?
A view is a virtual table that shows data from one or more tables. It does not store data itself but displays data based on a query.
Click to reveal answer
beginner
How do you drop a view in MySQL?
Use the command
DROP VIEW view_name; to remove a view from the database.Click to reveal answer
intermediate
Can you alter a view directly in MySQL?
No, MySQL does not support direct alteration of views. Instead, you drop the view and recreate it with the new definition.
Click to reveal answer
intermediate
What is the correct way to change a view's query in MySQL?
First drop the existing view using
DROP VIEW, then create a new view with the updated query using CREATE VIEW.Click to reveal answer
beginner
What happens if you try to drop a view that does not exist?
MySQL will return an error unless you use
DROP VIEW IF EXISTS view_name; which avoids errors if the view is missing.Click to reveal answer
Which command removes a view named 'sales_view' in MySQL?
✗ Incorrect
The correct command to remove a view is DROP VIEW followed by the view name.
How do you modify the query of an existing view in MySQL?
✗ Incorrect
MySQL requires dropping the view and recreating it to change its query.
What does the command DROP VIEW IF EXISTS view_name; do?
✗ Incorrect
This command safely drops a view only if it exists, preventing errors if it doesn't.
Which of the following is true about views?
✗ Incorrect
Views are virtual tables that show data based on queries but do not store data themselves.
If you want to change a view's structure, what is the first step?
✗ Incorrect
Since MySQL does not support ALTER VIEW, you must drop the view first before recreating it.
Explain how to safely remove a view in MySQL and what happens if the view does not exist.
Think about how to prevent errors when dropping something that might not be there.
You got /3 concepts.
Describe the process to change the query of an existing view in MySQL.
Remember MySQL's limitation on altering views.
You got /3 concepts.