SQL for Business Analysis Interview Questions for Business Analytics
46 SQL for Business Analysis questions with answers for business analytics roles — 15 easy, 23 medium, 8 hard.
About SQL for Business Analysis
SQL rounds check whether you can pull and validate your own data. Expect joins, GROUP BY and HAVING, subqueries, CTEs and window functions such as ROW_NUMBER, LAG and running totals. Business-flavoured problems like monthly revenue, top customers per segment, retention and funnels are common, along with debugging questions about duplicate rows and wrong totals.
What is a primary key?
Show answer
SQL: total revenue per month.
Show answer
What is SQL and why do business analysts need it?
Show answer
Difference between INNER JOIN and LEFT JOIN?
Show answer
SQL: top 5 customers by spend.
Show answer
What are aggregate functions?
Show answer
What is the difference between UNION and UNION ALL?
Show answer
What is a foreign key and what is referential integrity?
Show answer
What is an index in a database and when can it hurt performance?
Show answer
Write a SQL query to find the second-highest salary in an employees table.
Show answer
Write a SQL query to list customers who have never placed an order.
Show answer
Write a SQL query that groups customers into spend buckets using CASE WHEN.
Show answer
What is the difference between DELETE, TRUNCATE and DROP in SQL?
Show answer
What is COALESCE in SQL and how does it differ from ISNULL or IFNULL?
Show answer
What is the difference between COUNT(*) and COUNT(column)?
Show answer
What is a subquery and when would you use it?
Show answer
How do you find duplicate customers?
Show answer
How do you write a query to find users active in consecutive months?
Show answer
What does GROUP BY do and how is HAVING different from WHERE?
Show answer
What is the difference between OLTP and OLAP systems?
Show answer
How do you validate data before analysis?
Show answer
How do you calculate monthly revenue growth in SQL?
Show answer
What is a CTE?
Show answer
How do you find the top 5 customers by revenue?
Show answer
How do you handle NULL values when calculating averages?
Show answer
What are window functions in SQL and how are they different from GROUP BY?
Show answer
What is the difference between ROW_NUMBER, RANK and DENSE_RANK?
Show answer
After joining orders to a payments table, your total revenue doubled. What went wrong?
Show answer
Two analysts report different monthly active user numbers from the same database. How do you resolve it?
Show answer
Write a SQL query for the top 3 products by revenue in each category.
Show answer
Write a SQL query to calculate the repeat purchase rate.
Show answer
Write a SQL query to get each customer's first order date and first order amount.
Show answer
Write a SQL query to show cumulative revenue by month.
Show answer
Write a SQL query that shows revenue per region with one column per quarter.
Show answer
Tell me about a time a SQL query you wrote gave wrong results. How did you catch it?
Show answer
What is a self join? Give a business example.
Show answer
Write a SQL query to find the percentage of orders delivered late in each city.
Show answer
SQL: month-over-month revenue growth.
Show answer
What is normalisation, and why are analytics tables often denormalised?
Show answer
What is the logical order in which a SQL SELECT query is executed?
Show answer
A report query on a 200 million row table takes 15 minutes. How do you optimise it?
Show answer
Your LEFT JOIN report should list all customers, but customers without orders are missing. Why?
Show answer
Write a SQL query for a 7-day rolling average of daily revenue.
Show answer
Write a SQL query for a signup to purchase funnel from an events table.
Show answer
A query using NOT IN to find customers without orders returns zero rows, although you know such customers exist. Why?
Show answer
Frequently asked questions
How important is SQL for Business Analysis in Business Analytics interviews?
SQL rounds check whether you can pull and validate your own data. Expect joins, GROUP BY and HAVING, subqueries, CTEs and window functions such as ROW_NUMBER, LAG and running totals. Business-flavoured problems like monthly revenue, top customers per segment, retention and funnels are common, along with debugging questions about duplicate rows and wrong totals.
How should I use the SQL for Business Analysis sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.