Bird
0
0

Which of the following is the correct syntax to create a basic index on column email in PostgreSQL?

easy📝 Syntax Q12 of 15
PostgreSQL - Indexing Strategies
Which of the following is the correct syntax to create a basic index on column email in PostgreSQL?
ACREATE INDEX ON users email;
BCREATE INDEX idx_email ON users (email);
CMAKE INDEX idx_email ON users email;
DINDEX CREATE idx_email users (email);
Step-by-Step Solution
Solution:
  1. Step 1: Recall PostgreSQL index creation syntax

    The correct syntax starts with CREATE INDEX, followed by index name, ON table name, and column list in parentheses.
  2. Step 2: Match syntax to options

    CREATE INDEX idx_email ON users (email); matches the correct syntax exactly; others have wrong keywords or missing parentheses.
  3. Final Answer:

    CREATE INDEX idx_email ON users (email); -> Option B
  4. Quick Check:

    CREATE INDEX ... ON table (column) [OK]
Quick Trick: Use CREATE INDEX index_name ON table (column) [OK]
Common Mistakes:
  • Omitting parentheses around column name
  • Using wrong keywords like MAKE or INDEX CREATE
  • Missing ON keyword before table name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes