Bird
0
0

Identify the error in this SQL statement:

medium📝 Debug Q14 of 15
SQL - Indexes and Query Performance
Identify the error in this SQL statement:
CREATE INDEX ON employees (last_name);
ACannot create index on last_name column
BMissing table name after ON
CIncorrect use of parentheses around column name
DMissing index name after CREATE INDEX
Step-by-Step Solution
Solution:
  1. Step 1: Check the syntax of CREATE INDEX

    The syntax requires an index name after CREATE INDEX before ON.
  2. Step 2: Identify the missing part

    The statement lacks the index name, which causes a syntax error.
  3. Final Answer:

    Missing index name after CREATE INDEX -> Option D
  4. Quick Check:

    CREATE INDEX must have a name [OK]
Quick Trick: Always name your index after CREATE INDEX [OK]
Common Mistakes:
  • Omitting the index name
  • Confusing table name with index name
  • Misplacing parentheses

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes