0
0
MySQLquery~5 mins

Creating views in MySQL - Quick Revision & Summary

Choose your learning style9 modes available
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 create a simple view in MySQL?
Use the syntax: <br>CREATE VIEW view_name AS SELECT column1, column2 FROM table_name WHERE condition;
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. Complex views with joins or aggregations usually cannot be updated.
Click to reveal answer
beginner
Why use views instead of tables?
Views help simplify complex queries, hide sensitive data, and provide a consistent interface to data without duplicating it.
Click to reveal answer
intermediate
What happens if you drop a table that a view depends on?
The view will stop working because it depends on that table's data. You must drop or recreate the view after dropping the table.
Click to reveal answer
Which SQL command creates a view?
ASELECT VIEW
BCREATE TABLE
CCREATE VIEW
DINSERT VIEW
A view stores data separately from the tables it uses. True or False?
ATrue
BDepends on the database
COnly sometimes
DFalse
Which of these is a benefit of using views?
ASimplify complex queries
BStore large amounts of data
CReplace tables permanently
DIncrease database size
Can you create a view that joins multiple tables?
AYes
BNo
COnly in MySQL 8+
DOnly if tables have same columns
What happens if you try to update data through a complex view with joins?
AUpdate always succeeds
BUpdate usually fails
CView automatically converts to table
DData is duplicated
Explain what a view is and why you might use one in a database.
Think about how views help you see data without copying it.
You got /5 concepts.
    Describe the basic steps and syntax to create a view in MySQL.
    Remember the command starts with CREATE VIEW followed by a SELECT query.
    You got /5 concepts.