This question runs in a pre-configured Salesforce environment - no personal connection required.
Return a Map of country names to their total revenue for accounts with AnnualRevenue greater than 10000000. Use GROUP BY to aggregate by BillingCountry. Only include countries with total revenue greater than 50000000. Sort by total revenue descending. Use only safe Account fields (BillingCountry, AnnualRevenue). Return an empty Map if no countries meet the criteria.
Examples:
Input: None (query all accounts)
Output: Map<String, Decimal> {'USA' => 125000000, 'Germany' => 75000000}
Explanation: Countries with total revenue > 50M from high-value accounts (> 10M each)
Input: None
Output: Empty Map<String, Decimal>
Explanation: If no countries have total revenue > 50M, return empty map
Apex Code Editor
Welcome to Lightning Challenge!
Create an Account
Sign up to track your progress, earn points, and compete with others. Your solutions will be saved automatically.
Create accountHow It Works
- • Write your solution in the code editor
- • Connect your Salesforce org to test
- • Submit to check if your solution passes
- • Use hints if you get stuck
Note
You can test your code by connecting to Salesforce, but to save your progress and earn points, you'll need to create an account. Your solutions and achievements will be tracked automatically once you're logged in.