InterviewStack.io LogoInterviewStack.io

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.

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

Given transactions and accounts tables, write a query that computes total revenue per account for a date range but includes accounts with zero transactions in that range (they should show up with $0, not be silently dropped).

MediumTechnical
67 practiced

Write a query to find the latest/most recent record per entity when duplicates exist, for example the most recent version of a user record after repeated client retries, or a survey response table where you only want each user's latest response.

MediumTechnical
63 practiced

If you had a transaction-level sheet and needed a monthly summary by region, product, and channel with trend lines, how would you build the PivotTable and what options would you use to make it usable for non-technical stakeholders?

MediumTechnical
68 practiced

Write a query to compute month-to-date (MTD) revenue for the current month, and compare it to the same month-to-date point last year using the same number of business days rather than the same calendar dates.

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.