# Top 3 Industries by Revenue

**Type:** SOQL · **Difficulty:** Hard · **Topics:** GROUP BY, HAVING, LIMIT

Practice this problem interactively (write and run your SOQL against realistic data): https://www.forcechallenges.com/problems/top-industries-by-revenue

## Problem

Return the **three** industries with the highest total `AnnualRevenue`, considering only industries whose total exceeds **5,000,000**.

Return `Industry` and `SUM(AnnualRevenue)` aliased as `revenue`, sorted by revenue descending. Accounts with no Industry must be ignored.

## Constraints

- Alias the aggregate `revenue`.
- Use `HAVING` to filter groups, `LIMIT` to cap results.
- Row order is checked.

---
Source: ForceChallenges · last updated 2026-10-02
