Interview Q&A · SQL · 12 questions in this topic

Rapid-Fire Revision — SQL Interview Q&A

All SQL topics

One-line answers spanning the whole bank — the final pass the night before the interview. Part of Scenarios & Rapid Fire · 192 questions in the SQL bank.

This rapid-fire round condenses the SQL bank into short, testable answers. The cards cover distinctions that show up in screening rounds: WHERE versus HAVING, INNER versus LEFT JOIN, NULL comparison, and when a subquery becomes a window function. Treat each answer as a prompt for a small query you could write on a whiteboard, and open the linked topic when you need the full example rather than the summary. For each card, also name the clause that runs first and the row set it sees — that ordering explains most surprises.

Execution order?

Answer

FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → LIMIT.

WHERE vs HAVING?

Answer

WHERE filters rows before grouping; HAVING filters groups after.

Why does = NULL fail?

Answer

NULL comparisons yield UNKNOWN, never TRUE — use IS NULL.

Recommended resourcesAffiliate links · may earn us a commission

Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits