SQL Query Performance Quiz

This SQL quiz covers the performance questions that come up in backend interviews. You will read query plans, fix N+1 queries and slow pagination, and spot conditions that stop an index from being used.

Medium 10 questions ~6 minutes Pass at 80% SQLite

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

What does EXPLAIN (or EXPLAIN QUERY PLAN in SQLite) show you?

Show the answer

A. How the database plans to run the query: which indexes, scans and join order it uses The plan tells you whether a table is scanned in full or searched through an index, and in what order joins happen. In PostgreSQL EXPLAIN ANALYZE also runs the query and shows real timings, so be careful with it on UPDATE or DELETE.

What this quiz covers

  • Reading plans with EXPLAIN
  • N+1 queries and SELECT *
  • Keyset pagination instead of large OFFSET
  • Index-friendly conditions and type mismatches
  • Batching writes and keeping statistics fresh

Questions people ask

Do I need an account?

No. Anyone can play. Sign in to keep your XP, streak, badges and history.

Can I retake it?

Yes. Your best score is kept, and the questions and answers are shuffled each time.