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
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?

HardTechnical
72 practiced

Given transactions in multiple currencies and an fx_rates(rate_date, currency_code, usd_per_unit) table, write a query that converts each transaction to USD using the FX rate effective on its transaction date, falling back to the most recent prior available rate if that day's rate is missing.

EasyTechnical
59 practiced

Walk me through the differences between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN. Using two small tables (say customers and orders), show how the result set and row counts change for each join type, and call out what happens to unmatched rows on each side.

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.

MediumTechnical
55 practiced

Explain self-joins and anti-joins as distinct join patterns from a regular INNER/LEFT JOIN: what problem each one solves and when you'd reach for it. Then write a short anti-join example: given customers and orders tables, return customers who have no matching row in orders.

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.