3 traps from real analyst interviews. Each query looks right. Run it, watch the table act it out, and decide: is the number right?
Or browse 27 free interview questions →Your XP and streak start now. Sign in only if you want to keep them.

Made by Mohit Khandelwal, 5+ years in analytics. Each trap is a classic SQL mistake: the query runs, and the number still looks right. Read the story
Ratta nahi, riyaaz.
What's the total revenue from Mumbai? This query looks right.
| order_id | customer | city | amount | status | coupon |
|---|---|---|---|---|---|
| 101 | Asha | Mumbai | 1200 | completed | NEW10 |
| 102 | Ravi | Mumbai | 800 | cancelled | NULL |
| 103 | Asha | Mumbai | 500 | completed | NULL |
| 104 | Neha | Delhi | 900 | completed | FEST |
| 105 | Kabir | Mumbai | 300 | completed | NULL |
| 106 | Ravi | Pune | 700 | completed | NULL |
SELECT SUM(amount) AS revenue FROM orders WHERE city = 'Mumbai';
Runs in your browser in about a secondRuns in your browser. Edit it, or just run it first.

Made by Mohit Khandelwal, 5+ years in analytics. Each trap is a classic SQL mistake: the query runs, and the number still looks right. Read the story
Ratta nahi, riyaaz.
No account, no setup. The query runs on 6 rows you can see.
SELECT SUM(amount) AS revenue FROM orders WHERE city = 'Mumbai';Run
Rows light up as SQL picks them. You see 1,200 + 800 + 500 + 300 add up.
| customer | amount | status |
|---|---|---|
| Asha | 1200 | completed |
| Ravi | 800 | cancelled |
| Asha | 500 | completed |
| Neha | 900 | completed |
| Kabir | 300 | completed |
| Ravi | 700 | completed |
Decide before you fix. Hint: look at the status column.
Same idea: a small table, a query that looks right, a trap. Your XP from these counts too.
The tie that breaks LIMIT 1 OFFSET 1.
Try it, free →Know what you don't knowWhy NOT IN returns nothing when the list has a NULL.
Try it, free →Count rows before you add themOne order, several rows: the total is added twice.
Try it, free →Decide what a tie meansROW_NUMBER vs DENSE_RANK when people share a salary.
Try it, free →Check what's missingLAG compares rows, not months. What if a month is missing?
Try it, free →Decide what a tie meansPARTITION BY, and who gets dropped on a tie.
Try it, free →Your streak
A streak day is 20 XP (two traps). Come back tomorrow to make it 2 days.
+10 XP a trap
From the 3 traps and the free questions. Saved to your profile, on any device.
325 questions
Plus 28 lessons and timed level tests, on 35 messy business tables. Free.
A free website for learning SQL and practising for analyst interviews. It has 28 lessons, 325 practice questions with every trap explained, and timed level tests, all on 35 realistic business tables. Everything runs in your browser; there is nothing to install or pay for.
The traps and the 27 interview questions need no account. Sign in with Google only to save your progress, XP and streaks. Google shares your name, email address and profile photo, and we use them only for your ChaturIQ account. We never sell your data or show ads. Read our privacy policy and terms.