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. The first time any executable SQL statement references it

  4. Any time an executable SQL statement references it

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

A view is a virtual table that stores only a query definition, not data. Every time an executable SQL statement references the view, the underlying query executes to produce the result set dynamically - the view is repopulated on each reference.

AI explanation

A standard (non-materialized) database view has no stored data of its own — its defining query is re-executed every time any SQL statement references it, so it gets 'populated' fresh on each reference. It isn't populated only once at creation or only the first time it's used; each subsequent query against the view re-runs the underlying SELECT.