Skip to content

By role

SQL interview questions for data analysts

Data analyst screens lean on the same core: joins that keep the right rows, aggregates at the right grain, window functions for ranking and running totals, and the NULL traps that quietly change an answer.

Start with a free oneFilter all 229

What to get right

  1. Say the grain of the result out loud before you write a line: one row per what?
  2. Check what happens to groups with no rows. Interviewers add one on purpose.
  3. Use RANK when ties matter and say why you chose it over ROW_NUMBER.

Group and aggregate Read the lesson

Joins Read the lesson

Ranking and top N Read the lesson

Running totals, LAG and LEAD Read the lesson

NULL handling Read the lesson

Ratios and percentages Read the lesson

More for this role