Bird
0
0

Which of the following is the correct syntax to refresh a materialized view named sales_summary in PostgreSQL?

easy📝 Syntax Q12 of 15
PostgreSQL - Views and Materialized Views

Which of the following is the correct syntax to refresh a materialized view named sales_summary in PostgreSQL?

AREFRESH MATERIALIZED VIEW sales_summary;
BUPDATE MATERIALIZED VIEW sales_summary;
CREFRESH VIEW sales_summary;
DALTER MATERIALIZED VIEW sales_summary REFRESH;
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct command

    The correct command to update a materialized view is REFRESH MATERIALIZED VIEW view_name;.
  2. Step 2: Check each option

    REFRESH MATERIALIZED VIEW sales_summary; matches the correct syntax. UPDATE MATERIALIZED VIEW sales_summary;, REFRESH VIEW sales_summary;, and ALTER MATERIALIZED VIEW sales_summary REFRESH; use invalid commands or keywords.
  3. Final Answer:

    REFRESH MATERIALIZED VIEW sales_summary; -> Option A
  4. Quick Check:

    Correct syntax uses REFRESH MATERIALIZED VIEW [OK]
Quick Trick: Use REFRESH MATERIALIZED VIEW followed by view name [OK]
Common Mistakes:
  • Using UPDATE instead of REFRESH
  • Using REFRESH VIEW which is invalid
  • Trying ALTER to refresh

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes