Data science · Modelling and SQL — from a number to a decision

SQL that answers the question you were asked

The SQL round is not testing syntax, it is testing whether your query means what you think it means. This runs three queries that return confident wrong answers — a join that inflates revenue by 84%, a "never redeemed" filter that returns nothing because of one NULL, and a first-purchase query with a tie — and the window-function patterns that get each one right.

28 min read Full lesson in the app Patterns: join-fan-out, anti-join, window-functions, null-semantics

What you'll be able to do

Before this: cohorts-that-are-not-lying-to-you

Log in to read the rest of this lesson

The SQL round is not testing syntax, it is testing whether your query means what you think it means. This runs three queries that return confident wrong answers — a join that inflates revenue by 84%, a "never redeemed" filter that returns nothing because of one NULL, and a first-purchase query with a tie — and the window-function patterns that get each one right. This walkthrough runs about 28 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.

Log in to continue

The first module of every track is free to read on the web: see what's open in Data science.