Q1 enterprise revenue concentration
Problem
For completed Q1 2024 orders, return the top three Enterprise customers by revenue. Include company, order_count, and total_revenue.
Tables
Example rows — the live problem includes the full dataset.
customers
| id | company | segment | region |
|---|---|---|---|
| 1 | Northstar Analytics | Enterprise | NA |
| 3 | Helio Health | Enterprise | NA |
| 4 | Atlas Finance | Enterprise | EU |
orders
| id | customer_id | order_date | status | amount |
|---|---|---|---|---|
| 1 | 1 | 2024-01-12 | completed | 520 |
| 6 | 4 | 2024-02-11 | completed | 2200 |
| 10 | 6 | 2024-03-24 | completed | 1040 |
Expected output
Your answer should return 3 rows with the columns company, order_count, total_revenue.
Starter code (SQL)
SELECT *
FROM customers;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock