Questions: SQL Views and Materialized Views

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A DBA creates a view called monthly_sales_summary that joins five large tables and computes SUM and COUNT aggregations. A dashboard queries this view every 5 minutes. What performance problem should the DBA anticipate?

ANone — views automatically cache their results, so repeated queries are fast
BThe view's JOIN and aggregation logic executes fresh on every query, potentially making each dashboard refresh expensive
CThe view will accumulate stale data over time, gradually degrading read performance
DViews containing GROUP BY are invalid SQL and this definition will fail
Question 2 Multiple Choice

A company grants employees SELECT access to an employee_directory view (showing name, email, department) but not to the underlying employees table (which also contains salary and SSN). An employee runs SELECT * FROM employee_directory. What does the database actually do?

AReturns a pre-stored snapshot of the permitted columns from the last time the view was refreshed
BExecutes the view's underlying SELECT query against the current employees table, returning only the columns the view exposes
CRaises an error because employees lack direct table access, making the query impossible
DPrompts the DBA to approve the access before returning results
Question 3 True / False

A regular SQL view improves query performance because the database pre-computes and stores the view's result on disk, making subsequent reads faster.

TTrue
FFalse
Question 4 True / False

A SQL view can enforce security by limiting which columns or rows a user can see, even when the user has no direct access to the underlying table.

TTrue
FFalse
Question 5 Short Answer

Explain the key difference between a regular view and a materialized view in terms of what is stored, and describe the tradeoff this creates.

Think about your answer, then reveal below.