Bird
0
0

Which of the following is the correct syntax to create an index on the column 'email' in the 'users' table?

easy📝 Syntax Q3 of 15
PostgreSQL - Performance Tuning
Which of the following is the correct syntax to create an index on the column 'email' in the 'users' table?
ACREATE TABLE idx_email ON users(email);
BCREATE INDEX idx_email ON users(email);
CCREATE INDEX email_idx users(email);
DINDEX CREATE idx_email ON users(email);
Step-by-Step Solution
Solution:
  1. Step 1: Recall the syntax for creating an index

    The correct syntax is CREATE INDEX index_name ON table_name(column_name);
  2. Step 2: Match syntax with options

    CREATE INDEX idx_email ON users(email); matches the correct syntax exactly.
  3. Final Answer:

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

    Index creation syntax = CREATE INDEX idx_email ON users(email); [OK]
Quick Trick: Use CREATE INDEX index_name ON table(column) [OK]
Common Mistakes:
  • Swapping CREATE TABLE with CREATE INDEX
  • Omitting ON keyword
  • Incorrect order of keywords

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes