SQLMentor // articles

SQL Articles

Short, focused explainers on the SQL concepts that come up in real work and interviews — usually two things that look similar but behave differently. Each article has a worked example you can run yourself in the free SQL editor.

ROW_NUMBER vs RANK vs DENSE_RANK

The three ranking window functions, side by side — the entire difference comes down to how each one handles ties.

IN vs EXISTS

How they differ, and the NOT IN / NULL trap that can silently return zero rows from a query that looks correct.

WHERE vs HAVING

Why WHERE can't use aggregate functions, when HAVING is actually needed, and the most common mistake to avoid.

LEFT JOIN vs INNER JOIN

The core difference, plus the classic WHERE-clause trap that silently turns a LEFT JOIN back into an INNER JOIN.

SQL NULL Handling

Why col = NULL never matches, and where NULL quietly changes the behaviour of aggregates, NOT IN, and sorting.

Looking for more structured learning instead? Start with the Oracle SQL tutorial, work through the 30 practice exercises, or bookmark the Oracle SQL cheat sheet.