SQL Advanced (Analytics)
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Index Concept and Data Structure — B-tree data structures accelerate column searches compared to default sequential full table scans.
  2. Read vs Write Workload Trade-Offs — Search speed gains come at the cost of slower insert and update execution times.
  3. Inspecting and Creating Single Indexes — Existing table indexes are viewed and a new single-column index is added to last_name.
  4. Multi-Column Indexes and Leftmost Prefix — Composite indexes require a defined column order to leverage MySQL leftmost prefix searching.
  5. Dropping Redundant Indexes — Redundant single-column indexes are removed using the ALTER TABLE DROP INDEX statement.
PDF notes

Frequently asked questions

Does MySQL automatically create any indexes?

Yes, MySQL automatically creates a primary key index when you define a primary key column.

Can a multi-column index on (last_name, first_name) speed up searches on first_name alone?

No, MySQL requires the leftmost prefix (last_name) in the filter condition to navigate the composite index.

Why is my query using an index not noticeably faster on my local test database?

Small datasets have so few records that sequential scans finish instantaneously, whereas benefits become obvious on millions of rows.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.