Bird
0
0

Which of the following commands correctly creates a BRIN index on the created_on column of the user_activity table?

easy📝 Syntax Q3 of 15
PostgreSQL - Indexing Strategies
Which of the following commands correctly creates a BRIN index on the created_on column of the user_activity table?
ACREATE INDEX ON user_activity (created_on) USING brin_index;
BCREATE BRIN INDEX user_activity ON created_on;
CCREATE INDEX brin_user_activity ON user_activity (created_on) USING btree;
DCREATE INDEX ON user_activity USING brin (created_on);
Step-by-Step Solution
Solution:
  1. Step 1: Recall BRIN index syntax

    The correct syntax is CREATE INDEX [name] ON [table] USING brin (column);
  2. Step 2: Analyze options

    CREATE INDEX ON user_activity USING brin (created_on); matches the correct syntax without specifying an index name (which is optional).
  3. Final Answer:

    CREATE INDEX ON user_activity USING brin (created_on); -> Option D
  4. Quick Check:

    Correct syntax uses 'USING brin' [OK]
Quick Trick: Use 'CREATE INDEX ON table USING brin (column)' syntax [OK]
Common Mistakes:
  • Using 'CREATE BRIN INDEX' which is invalid
  • Specifying btree instead of brin
  • Incorrect placement of USING clause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes