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
64 practiced

Define 'monthly churn rate' for a subscription product and write the SQL to compute it: churn = users who were active in month M-1 but had no activity (or canceled) in month M. State the edge cases you had to decide on.

MediumTechnical
70 practiced

Write a query that computes the time between two related events per entity, for example the average time from a user's first visit to their first purchase, or a support ticket's time from creation to first response.

MediumTechnical
56 practiced

Write a query to compute a simple customer lifetime value (LTV): total revenue per customer since signup, using orders(user_id, order_date, amount). Then classify customers into LTV buckets (low/medium/high).

MediumTechnical
64 practiced

You receive a CSV export with inconsistent date formats, extra spaces, merged cells in headers, and product names that differ only by spelling or casing. How would you clean and structure it in Excel so it can be analyzed reliably without losing the original raw data?

MediumTechnical
53 practiced

Write a data-profiling query: for every column in a table, return the null count, distinct count, min, and max (or a few sample values), so you can quickly assess a new dataset's quality before building on top of it.

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.