SQL for Data Analysis Questions

Writing SQL to answer analytical and business questions. Covers filtering, joins, grouping and aggregation, subqueries, CTEs, and translating an ambiguous request into a correct query. Includes spreadsheet-to-SQL fluency for everyday analyst workflows.

HardTechnical
70 practiced

Your pipeline-based revenue forecast has been underestimating actual realized revenue by about 20% historically. Describe the SQL-driven analyses you'd run to diagnose likely root causes (for example win-rate by stage, close-date slippage, discounting), and propose one or two SQL metrics to track whether it improves.

MediumTechnical
70 practiced

What's the difference between 'retention' and 'churn' as growth-analytics terms, and what are two different ways you could define each in SQL depending on the business (subscription cancellation vs. inactivity-based churn)? Explain the trade-offs of each definition.

MediumTechnical
77 practiced

How does SQL handle NULL? Explain why col != 'x' silently drops rows where col is NULL, why you need IS NULL / IS NOT NULL instead of = NULL, and what COALESCE does. Then show how NULL affects COUNT(*), COUNT(column), and an AVG() computed after a LEFT JOIN.

EasyTechnical
71 practiced

Write a query to find customers who have never placed an order. Given customers(customer_id, email) and orders(order_id, customer_id), return customer_id and email for every customer with zero matching orders.

EasyTechnical
53 practiced

What are the common ways to bucket a timestamp into a reporting period (daily, weekly, monthly, fiscal)? For each, describe a scenario where it's the natural choice and one pitfall (week boundaries, month-length differences, timezone).

Unlock Full Question Bank

Get access to all SQL for Data Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.