0
0
MySQLquery~5 mins

View limitations in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a view in MySQL?
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
Can you perform INSERT, UPDATE, or DELETE on any MySQL view?
No, you can only perform these operations on views if they are updatable. Some views are not updatable due to their complexity or use of certain SQL features.
Click to reveal answer
intermediate
Why can't views with GROUP BY clauses be updated directly?
Because GROUP BY summarizes data, it is unclear how to update individual rows in the original tables from the grouped results.
Click to reveal answer
intermediate
Are views that use UNION or DISTINCT updatable in MySQL?
No, views that use UNION or DISTINCT are not updatable because they combine or filter rows in ways that prevent direct row mapping to base tables.
Click to reveal answer
beginner
What happens if you try to create an index on a MySQL view?
MySQL does not allow creating indexes on views because views do not store data physically.
Click to reveal answer
Which of the following is true about MySQL views?
AViews store data physically in the database.
BViews can always be updated regardless of their query.
CViews can have indexes created on them.
DViews are virtual tables based on queries.
Why are views with GROUP BY clauses not updatable?
ABecause GROUP BY changes the structure of the base tables.
BBecause GROUP BY summarizes data making row updates ambiguous.
CBecause GROUP BY requires indexes on views.
DBecause GROUP BY is not supported in views.
Which SQL feature in a view prevents it from being updatable?
ASimple SELECT from one table
BUse of ORDER BY without LIMIT
CUse of UNION or DISTINCT
DUse of WHERE clause
Can you create an index on a MySQL view?
ANo, because views do not store data.
BOnly if the view is updatable.
CYes, always.
DOnly on views with a primary key.
Which operation is NOT always allowed on a MySQL view?
AINSERT
BSELECT
CJOIN
DWHERE filtering
Explain why some MySQL views are not updatable and give examples of SQL features that cause this limitation.
Think about how the view's query affects the ability to map changes back to base tables.
You got /4 concepts.
    Describe what a view is in MySQL and list at least two limitations related to modifying data through views.
    Focus on the nature of views and their interaction with data modification.
    You got /4 concepts.