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.

HardTechnical
113 practiced

In VBA or Office Scripts, how would you automate a repetitive Excel reporting task that imports a CSV, cleans the headers, refreshes summary sheets, and exports a PDF for distribution? What would you automate first, and how would you make the script robust to missing or malformed data?

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.

MediumTechnical
75 practiced

Write a query to compute simple weekly retention for new users: define the cohort as signup week, and for each cohort week report the percentage of users who had at least one event in each of the following weeks.

EasyTechnical
73 practiced

What's a window function, and when would you reach for one instead of GROUP BY? Give one example where GROUP BY collapses the rows you need and a window function (like a running total or a per-row rank) is the right tool because you still need one row per input row.

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.