← All games

SQL Index Quest

Choose the best database index for simplified schemas and queries while learning full scans, covering indexes, sort avoidance, and composite order.

Concept
Database indexing and query performance
Difficulty
Intermediate
Play time
7-10 minutes
Path
Data & Performance

Interactive scenario

Playable game area: Make the next backend decision

Use the controls below. Feedback appears immediately and final scores stay in this browser.

Concept notes

Why this decision matters

SQL Index Quest is focused practice for Database indexing and query performance. It explains why each answer is safe, risky, or production-ready.

SQL indexes are one of the highest-leverage backend performance tools. This game simplifies query planning so you can practice the judgment behind index selection.

Learning objectives

  • Choose indexes that match filters and ordering.
  • Apply the leftmost prefix rule for composite indexes.
  • Recognize when an index is low-value or creates unnecessary write overhead.

How to play

  1. Read the indexing scenario, its evidence, and the stated constraints.
  2. Choose one strategy that best addresses the indexing goal described.
  3. Select Submit decision, read the explanation, then choose Next challenge or Finish run.
  4. The gauges illustrate constraints, not measured query performance. Feedback is not a query plan generated by a database.

Scoring

  • Your score ranges from 0 to 1000 and reflects the quality of your decisions.
  • Consistently strong decisions at harder difficulty levels earn an extra bonus.
  • Completing all eight decisions adds a completion bonus.
  • Response time does not affect your score. Take time to read the evidence and explanations.

Backend concept notes

Indexes speed reads by keeping ordered lookup structures, but every index costs storage and write work. Backend engineers choose indexes for real query patterns, not for every column.

Composite index order matters. An index on (user_id, created_at) helps queries that start with user_id, but it does not act like a standalone created_at index for every query.

Common mistakes

  • Indexing a low-cardinality boolean column by itself and expecting a large speedup.
  • Creating composite indexes in the wrong column order.
  • Ignoring ORDER BY and then paying for a separate sort.

Review misses from this game

Related Backend Study Lab tools

Use tools from the main site when you want to inspect real inputs.

FAQ

Short answers for how this game fits backend interview and study practice.

Does every foreign key need an index?

Many do, especially when joined or filtered often, but the final choice should come from query patterns and write costs.

What is a covering index?

A covering index includes all columns needed by a query, allowing the database to answer from the index without reading the table row.

Leaderboard

Top 10 scores for the current ruleset. No account required.

Loading leaderboard...

    Finish the game to load your latest local score.