Bird
0
0

Which SQL statement correctly creates a B-tree index on the column last_name of the table employees?

easy📝 Syntax Q12 of 15
SQL - Indexes and Query Performance
Which SQL statement correctly creates a B-tree index on the column last_name of the table employees?
ACREATE INDEX idx_last_name ON employees USING HASH (last_name);
BCREATE INDEX idx_last_name ON employees (last_name) USING BITMAP;
CCREATE INDEX idx_last_name ON employees (last_name);
DCREATE INDEX idx_last_name ON employees USING FULLTEXT (last_name);
Step-by-Step Solution
Solution:
  1. Step 1: Identify default index type in SQL

    By default, CREATE INDEX creates a B-tree index unless specified otherwise.
  2. Step 2: Check syntax correctness

    CREATE INDEX idx_last_name ON employees (last_name); uses correct syntax without specifying a different index type, so it creates a B-tree index on last_name.
  3. Final Answer:

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

    Default index type = B-tree [OK]
Quick Trick: Default index type is B-tree unless stated otherwise [OK]
Common Mistakes:
  • Using HASH or FULLTEXT without need
  • Adding unsupported index types like BITMAP in standard SQL
  • Incorrect syntax for index creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes