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

Instruction

Okay, time to wrap things up. First a summary of what we've learned:

  1. Updatable views are views which satisfy multiple conditions. Whenever an updatable view is modified, the underlying table is also changed. In practice, updatable views are rarely used to update data.
  2. Materialized views are created in the following way:
    CREATE MATERIALIZED VIEW top100_universities AS
    SELECT ...
  3. Unlike normal views, the query in a materialized view is only run once (when we create the view). The resulting rows are physically stored in the database. You can manually refresh the data by writing:
    REFRESH MATERIALIZED VIEW top100_universities;
  4. To remove a materialized view, use:
    DROP MATERIALIZED VIEW top100_universities;
  5. Materialized views provide you with quicker access to data, but they use space in the database. You also need to remember to refresh materialized views. Normal views provide slower access to data, but they don't take up space and they always contain updated information.

All right, how about a pop quiz?

Exercise

Click Next exercise to continue.