Multiple choice technology databases

When does a view get populated?

  1. When it is created

  2. When it is referenced in an INSERT statement

  3. Any time an executable SQL statement references it

  4. The first time any executable SQL statement references it

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Views are virtual tables that don't store data - they execute the underlying query each time they're referenced. A view populates dynamically whenever any executable SQL statement (SELECT, INSERT, UPDATE, DELETE) references it. Views don't cache results and don't populate at creation time.

AI explanation

A view is just a stored query definition — it has no data of its own until it is actually queried. Each time any executable SQL statement references the view, the database re-runs the underlying query against the base tables to produce the result set. This is different from a materialized view, which does store data physically; a plain view is recomputed on every reference, not just once when created or first used.