Bird
0
0

Which of the following is the correct syntax to create an index named idx_name on the column last_name of the table employees?

easy📝 Syntax Q12 of 15
SQL - Indexes and Query Performance
Which of the following is the correct syntax to create an index named idx_name on the column last_name of the table employees?
ACREATE idx_name INDEX ON employees (last_name);
BCREATE INDEX idx_name ON employees (last_name);
CINDEX CREATE idx_name ON employees (last_name);
DCREATE INDEX ON employees idx_name (last_name);
Step-by-Step Solution
Solution:
  1. Step 1: Recall the standard CREATE INDEX syntax

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

    CREATE INDEX idx_name ON employees (last_name); matches the correct order and keywords exactly.
  3. Final Answer:

    CREATE INDEX idx_name ON employees (last_name); -> Option B
  4. Quick Check:

    CREATE INDEX index_name ON table (column) [OK]
Quick Trick: Remember: CREATE INDEX name ON table (column) [OK]
Common Mistakes:
  • Swapping index name and table name positions
  • Using wrong keyword order
  • Omitting ON keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes