Multiple choice technology databases

What does the FORCE option for creating a view do?

  1. creates a view with constraints

  2. creates a view even if the underlying parent table has constraints

  3. creates a view in another schema even if you don't have privileges

  4. creates a view regardless of whether or not the base tables exist

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

The FORCE option in SQL view creation allows creating a view even when the base tables don't exist yet. This is useful for defining view structures before the underlying data is available. Without FORCE, the view creation would fail if base tables are missing.

AI explanation

The FORCE keyword in CREATE VIEW (e.g. in Oracle) tells the database to create the view even if the tables or columns it references don't exist yet or the owner lacks privileges on them — the view is created but flagged invalid until the dependencies exist. This is useful for deploying scripts where object creation order isn't guaranteed. It doesn't grant cross-schema privileges or alter constraint handling on the base tables.