SQL Quest

Lessons, hints, explained solutions, the in-browser PostgreSQL editor and practice answer checks in your browser are available. Graded assessments, recorded progress from answer checks and new certificates aren't available yet.

Timed SQL interview simulation

Six classic SQL interview problems in 45 minutes, the kind asked in analyst and data-engineering interviews: the latest record per entity, top-N per group (with ties), gaps and islands, month-over-month growth, retention, duplicates, medians and 'did X but not Y'. Each attempt draws six different patterns from realistic business databases. As in a real interview, read the definitions carefully: edge cases (ties, NULLs, boundaries) decide the answer. Graded on the public data and a hidden copy. Pass mark 70%.

Questions
6 drawn from 16
Time
45 minutes
Pass mark
70%
Retake
after 6 hours

How it works

  • Questions are drawn at random across the skills below, easiest first. A retake avoids the questions of your previous attempt wherever the question bank has others for that skill.
  • You can run queries on the real dataset as often as you like. Answers save as you type; nothing is graded until you submit.
  • The timer is kept on the server and covers writing your answers. When time runs out, your saved answers are graded as they are.
  • A query that errors or runs longer than the grader's time limit counts as not correct. A problem on our side (for example the grader being busy) never does: the attempt stays open with your answers saved, and you can submit again.
  • Each answer is graded by results on the dataset and on a hidden copy with different rows. Afterwards you see which answers passed, with the model solution and an explanation.
  • It's open-book and not proctored.

Skills covered

  • ROW_NUMBER, RANK, DENSE_RANK
  • Top-N per group
  • Time series and date spines
  • Period-over-period comparison
  • Retention and churn
  • Detecting and removing duplicates
  • NTILE, percentiles and distributions
  • EXISTS and NOT EXISTS
Not available yet. Graded assessments aren't available yet: they need SQL Quest's server-side grader, which is switched off until its security review is complete. You can still practise every lesson and check practice answers in your browser.