0
0
SQLquery~5 mins

Views for security and abstraction in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a SQL view?
A SQL view is a virtual table based on the result of a SQL query. It does not store data itself but shows data from one or more tables.
Click to reveal answer
beginner
How do views help with security in databases?
Views restrict user access by showing only specific columns or rows, hiding sensitive data from users who don't have full table access.
Click to reveal answer
intermediate
Explain abstraction in the context of SQL views.
Abstraction means hiding complex table structures or joins behind a simple view, so users can work with easy-to-understand data without knowing the details.
Click to reveal answer
intermediate
Can you update data through a SQL view?
Some views are updatable, meaning you can insert, update, or delete data through them if they meet certain conditions, like referencing a single table without aggregates.
Click to reveal answer
beginner
Write a simple SQL statement to create a view that shows only employee names and departments.
CREATE VIEW EmployeeDept AS SELECT name, department FROM Employees;
Click to reveal answer
What does a SQL view store?
AThe actual data from tables
BIndexes for faster queries
COnly the query definition, not data
DUser permissions
How can views improve database security?
ABy encrypting the data
BBy speeding up queries
CBy backing up data automatically
DBy hiding sensitive columns or rows
Which of these is a benefit of using views for abstraction?
AUsers must write complex joins
BUsers see simplified data structures
CViews increase storage space
DViews prevent all data updates
When is a view updatable?
AWhen it references a single table without aggregates
BWhen it uses aggregate functions
CWhen it includes multiple tables with joins
DWhen it contains subqueries
Which SQL keyword is used to create a view?
ACREATE VIEW
BCREATE TABLE
CCREATE INDEX
DCREATE PROCEDURE
Describe how views can be used to protect sensitive data in a database.
Think about showing only what users need to see.
You got /4 concepts.
    Explain the concept of abstraction with SQL views and why it is helpful for users.
    Imagine making a complicated table look simple.
    You got /4 concepts.