Bird
0
0

Identify the error in this SQL statement: CREATE INDEX ON users(email);

medium📝 Debug Q6 of 15
SQL - Indexes and Query Performance

Identify the error in this SQL statement: CREATE INDEX ON users(email);

ACREATE INDEX cannot be used on email column
BTable name is incorrect
CColumn name should be in quotes
DMissing index name after CREATE INDEX
Step-by-Step Solution
Solution:
  1. Step 1: Review correct CREATE INDEX syntax

    The syntax requires an index name after CREATE INDEX before ON.
  2. Step 2: Check the given statement

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

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

    CREATE INDEX needs a name [OK]
Quick Trick: Always name your index after CREATE INDEX [OK]
Common Mistakes:
  • Omitting index name
  • Quoting column names unnecessarily
  • Assuming any column cannot be indexed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes