June 18, 2026

SQL and Database Interview Questions: Queries, Indexes, and Transactions

June 18, 2026 · 8 min read

  • SQL
  • Databases
  • Technical interviews

Database rounds test whether you can reason about data under load, not just write SELECT statements. Expect both whiteboard SQL and design questions about schema and consistency.

SQL skills to rehearse

  • JOIN types — inner, left, self; when each is appropriate.
  • Aggregations — GROUP BY, HAVING, window functions for rankings and running totals.
  • Subqueries vs CTEs — readability and optimizer behavior at a high level.
  • Indexes — B-tree basics, composite indexes, covering indexes, when indexes hurt writes.
  • Transactions — ACID, isolation levels, deadlocks, optimistic vs pessimistic locking.

System-style database questions

You may be asked to design tables for a feature, choose SQL vs NoSQL, or explain sharding and replication. State read/write ratio, consistency needs, and hot keys before proposing a schema.

Production anecdotes help

Mention a slow query you fixed: EXPLAIN output, index added, latency before/after. If you use an interview copilot, tag resume projects that involved Postgres, MySQL, or ORM tuning so suggestions reference your actual stack instead of generic examples.

Try Transcripta for your next interview

Live transcription, question detection, and resume-aware answer suggestions in a desktop overlay.