Skip to content

SQL Interview Questions for Business Analyst

4 SQL questions with answers for business analyst roles. Tick what you have solved to track your progress.

Sheet progressStart practicing
01

SQL: total revenue per month.

Show answer
SELECT DATE_TRUNC('month', order_date) AS month, SUM(amount) AS revenue FROM orders GROUP BY 1 ORDER BY 1; -- MySQL: DATE_FORMAT(order_date, '%Y-%m')
02

SQL: top 5 customers by spend.

Show answer
SELECT customer_id, SUM(amount) AS spend FROM orders GROUP BY customer_id ORDER BY spend DESC LIMIT 5;
03

SQL: month-over-month revenue growth.

Show answer
WITH m AS (SELECT month, SUM(amount) AS rev FROM orders GROUP BY month) SELECT month, rev, ROUND(100.0 * (rev - LAG(rev) OVER (ORDER BY month)) / LAG(rev) OVER (ORDER BY month), 1) AS mom_pct FROM m;
04

How do you validate data before analysis?

Show answer
Check row counts against the source, nulls, duplicates on keys, value ranges, date coverage and that totals reconcile with finance reports.