Skip to content
Sign inJoin free

SQL rounds: the patterns that keep coming up

Cortopus team

Most SQL interview questions are variations on a handful of patterns. If you're comfortable with these, you're in good shape.

Joins and what happens to rows that don't match. Aggregations with GROUP BY and HAVING. Window functions, especially ranking within groups and running totals. Finding duplicates. Comparing a row to the previous one (LAG and LEAD). Dates: grouping by week or month, and working out gaps between events.

Practise talking while you write the query. Interviewers care a lot about how you check your own work, like asking what happens with nulls or empty groups.

Which SQL question caught you out? Post it and let's work through it.

Replies

No replies yet. Sign in to be the first to help.

Have something to add?

Sign in to reply, react and follow this post.