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.

MediumTechnical
69 practiced

A manager asks you to explain why sales dropped last week, and the only input you have is a raw Excel export from the CRM. How would you structure the investigation in Excel from the first pass to the final answer, and what analyses would you prioritize?

MediumTechnical
58 practiced

Write a query that computes month-over-month percentage change in total revenue, one row per month. Explain how you'd handle the first month in the series (no prior month to compare against).

MediumTechnical
76 practiced

For business reporting, how do SUMIFS, COUNTIFS, and AVERAGEIFS compare with PivotTables? When would you prefer conditional aggregate formulas instead of a PivotTable, and when would you avoid them?

EasyTechnical
64 practiced

When would you reach for SQL instead of doing the analysis in a spreadsheet or a BI tool's built-in functions (like a pivot table or VLOOKUP-style lookup)? Give two concrete examples of tasks that are much better done in SQL and explain what a spreadsheet approach would struggle with.

HardTechnical
63 practiced

Given a contracts table where revenue is recognized evenly over the contract term, write SQL to produce recognized revenue per month across the whole portfolio, correctly prorating any contract whose start or end falls mid-month.

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.