Bird
0
0

Which condition must be true for a view in PostgreSQL to be updatable?

easy📝 Conceptual Q1 of 15
PostgreSQL - Views and Materialized Views
Which condition must be true for a view in PostgreSQL to be updatable?
AThe view must include at least one JOIN between tables.
BThe view must use GROUP BY clauses.
CThe view must be based on a single table without any aggregate functions.
DThe view must contain UNION statements.
Step-by-Step Solution
Solution:
  1. Step 1: Understand updatable view basics

    Updatable views in PostgreSQL require a simple structure, typically based on a single table without aggregates or joins.
  2. Step 2: Analyze the options

    Options A, C, and D include joins, grouping, or unions, which make views non-updatable by default.
  3. Final Answer:

    The view must be based on a single table without any aggregate functions. -> Option C
  4. Quick Check:

    Updatable view condition = single table, no aggregates [OK]
Quick Trick: Updatable views need simple single-table SELECTs [OK]
Common Mistakes:
  • Thinking joins allow updates through views
  • Assuming GROUP BY views are updatable
  • Believing UNION views can be updated

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes