SQL guides
Practice sets and short explanations of the mistakes almost everyone makes. Every page has exercises you can run right here, with no signup.
Practice sets
Common mistakes, explained
- LEFT JOIN COUNT(*) returns 1 instead of 0: why, and the fixWhy a group with nothing in it shows a count of 1 after a LEFT JOIN, and how to get 0.
- WHERE vs HAVING: which one filters what?WHERE filters rows, HAVING filters groups. One small table shows both in the same query.
- Why does my JOIN return duplicate rows?Why the same name shows up several times after a JOIN, and three ways to get one row each.
- Why does my LEFT JOIN behave like an INNER JOIN?Why rows disappear from a LEFT JOIN when you add a WHERE, and where the condition should go.
- Why does NOT IN return no rows?One NULL in the list makes NOT IN return nothing, with no error. Why, and what to write instead.
- Why is my SUM too high after a JOIN?Why a total doubles or triples after a JOIN, and how to add it up once.
No guides match that yet.
Want the full path? MintQuery teaches SQL from the first SELECT to interview questions, in lessons of a few minutes.
Start freeGet the app