Valint & Balk

180 SQL interview questions. Every answer was run.

An e-book for the SQL round of a data analyst, data scientist, data engineer or AI engineer interview. Each answer shows the rows the database returned. 168 of the 180 also show the classic wrong query.

A page of the book: a question, its answer, the output table and the classic mistake
A page of the book, as you get it
The e-book$19

PDF (369 pages), EPUB and MOBI. Paid once, plus VAT where it applies. You can ask for a refund within 30 days.

Get the book for $19

Not sure yet? Read 30 of the 180 questions free first (76-page PDF, no e-mail asked).

What is inside

  • 180 questions in 12 chapters

    Filtering, aggregates, joins, NULLs, subqueries, CTEs and recursion, window functions, dates, strings, set operations, and the questions interviewers ask aloud.

  • The answer and its output

    Every answer was run on PostgreSQL 16 and on a second database engine, with the same rows. The table under each answer is what the database returned, so you can check your own rows against it.

  • The classic mistake

    168 of the 180 questions also print the classic wrong query, with the rows it returns and why they are wrong. You meet the mistake at home first.

  • How to think about it

    A short explanation in the order an interviewer wants to hear it.

  • One small shop database

    All 180 questions are set in one shop database of nine tables. The book prints every row and the script that builds them, so you can run everything yourself.

  • Three levels

    Each question is marked easy, medium or hard.

Get it

Free sample

$0

30 of the 180 questions with their answers, from all 12 chapters. A 76-page PDF. No e-mail needed.

Download free

The full e-book

$19

All 180 questions. PDF (369 pages), EPUB and MOBI. Paid once, plus VAT where it applies. You can ask for a refund within 30 days.

Buy for $19

How to use it

  1. Read the question and write your own query first.
  2. Compare your rows with the printed output.
  3. Read the explanation, then run the classic mistake and see what it returns.
  4. The week before the interview, do the hard questions again with a clock.

Sold through Gumroad. You can ask for a refund within 30 days.

Disagree with an answer? Write to [email protected]. If you are right, we fix it in the next edition.