Almost every beginner stumbles on the same seven things, and most of them are not syntax errors. The query runs, the database says nothing, and the answer is still wrong. Knowing which mistakes are structural rather than typographic is what turns a month of flailing into a month of progress.
The seven, roughly in the order you meet them
Read the list once now, then again after a week at the keyboard. The order matters: each mistake makes the following one more likely, which is why they arrive in a cluster rather than one at a time.
- Learning the keywords before the data. You can write WHERE before you can say what one row of the table represents. Grain comes first; the rest is vocabulary.
- Reaching for SELECT *. It hides which columns exist, breaks when a column is renamed, and pulls data you never needed. Name the columns you actually want.
- Filtering rows when you meant to filter groups. A condition on a summed value belongs in HAVING; putting it in WHERE either errors or silently keeps the wrong groups.
- Treating NULL as zero or as an empty string. Comparisons against NULL are unknown, not true, so rows vanish from results and totals shift without a warning.
- Joining without checking the key. When one side has duplicate keys, every match multiplies rows and the totals quietly inflate.
- Trusting a query because it ran. No error does not mean a correct answer; it means the engine could parse it.
- Working in one tab and never saving. Without a saved file you cannot compare, cannot explain, and end up rewriting yesterday’s work.
Why these survive a whole course
Tutorial datasets are built to be forgiving. They have clean keys, no duplicate rows, no nulls in the columns that matter, and one obvious join path. A beginner who learns on them never sees row multiplication, so the mistake stays invisible until a real table with a messy key arrives and the numbers are wrong in a way that looks like a database bug.
The second reason is that these mistakes produce a plausible answer. A wrong join still returns rows. A misplaced filter still returns a number. Nothing on screen signals that something is off, so the only defence is to check deliberately rather than to wait for the engine to complain.
A weekly check that catches most of them
- Before writing the query, say out loud what one row should be.
- Run a count on each table first, then a count of the joined result and compare.
- Read the column list of every table you touch, at least once.
- Re-read the query a day later without running it and predict the output.
- Keep the saved file in a folder you would show someone else.
None of these seven take long to fix once you can name them. The trick is to stop reading errors as the only feedback and start treating an unsurprising result as something you have to earn.