SQL interview questions

Data analyst SQL interview questions to practice in 30 minutes.

If a role says basic SQL, do not stop at syntax. Practice turning a business question into the right row grain, join path, grouped metric, and sanity check.

Staff+ Product Analytics Interview Packet cover
Short answer

Start with five patterns: filter and group, left join, cohort grouping, date windows, and a sanity check. Say the row grain before writing any query.

Practice these questions first

Use a tiny ecommerce, SaaS, or support schema. You do not need a huge dataset. You need clean thinking.

  • Find monthly active buyers from orders.
  • Calculate repeat purchase rate by signup month.
  • List the top customers by net revenue after refunds.
  • Compare trial-to-paid conversion by acquisition source.
  • Find users who signed up but never completed the first key action.
  • Calculate seven-day retention from an events table.
  • Flag duplicate orders or duplicate tickets.
  • Explain how nulls, many-to-many joins, or timezone windows could change the answer.

The 30-minute drill

Spend ten minutes writing queries, ten minutes explaining the grain, and ten minutes answering follow-up questions out loud.

  • For every query, write one sentence that starts with: one row represents.
  • Name the denominator before calculating a rate.
  • Use a left join once and explain which rows would disappear with an inner join.
  • Close with the check you would run before sending the metric to a stakeholder.

Common miss

Many candidates solve a query that runs but answers the wrong question. Interviewers notice when you protect the metric before celebrating the syntax.

  • Do not aggregate before confirming the event, customer, account, or order grain.
  • Do not mix refunded and completed orders unless the business question asks for gross activity.
  • Do not call a rate improved until you check denominator changes.

Quick answers

Short answers for searchers, interview prep, and AI answer engines.

What SQL topics should a data analyst interview cover?

Expect filters, joins, grouping, CASE logic, null handling, date windows, CTEs, and at least one metric sanity check.

Are window functions required for basic SQL interviews?

Not always. Many basic screens stop at joins and aggregates, but window functions help when the role touches retention, ranking, cohorts, or session analysis.

How do I sound stronger in a SQL interview?

State the business question, row grain, denominator, and quality check before treating the query output as final.

What packet should I use after basic SQL practice?

Use the Product Analytics packet if your loop includes SQL follow-ups, metrics, experiments, product cases, or recommendation questions.

Turn the answer into timed practice.

Use the free rep first. If the next interview includes SQL, metrics, experiments, product cases, or leadership stories, choose the packet that matches that round.