AnalystPath

Q1 enterprise revenue concentration

SQLHardSenior level~15 min

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
idcompanysegmentregion
1Northstar AnalyticsEnterpriseNA
3Helio HealthEnterpriseNA
4Atlas FinanceEnterpriseEU
orders
idcustomer_idorder_datestatusamount
112024-01-12completed520
642024-02-11completed2200
1062024-03-24completed1040

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

Related SQL questions