Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Updatable views
2. Updatable views
Materialized views
Summary

Instruction

First, let's briefly introduce the concept of an "updatable view". A view is updatable when it meets the following criteria:

  1. The view is based on a single table.
  2. The view doesn't use GROUP BY, HAVING, UNION/INTERSECT/EXCEPT, SELECT DISTINCT, or aggregate functions.
  3. The columns of the underlying table that aren't included in the view must be NULLable or have DEFAULT values.

When a view is updatable, you can use INSERT, UPDATE, and DELETE statements on it. The underlying table will also be modified automatically.

In practice, however, updating tables via views is done very rarely. We won't introduce any exercises on updatable views – just keep in mind that such a concept exists.

Exercise

Click Next exercise to continue.