This question runs in a pre-configured Salesforce environment - no personal connection required.

Query all accounts and find the minimum annual revenue for each country. Return a Map where the key is the BillingCountry and the value is the minimum AnnualRevenue for accounts in that country. Only include countries that have at least one account with non-null AnnualRevenue.

Use SOQL aggregation with the MIN() function and GROUP BY clause to find the minimum revenue per country. Filter out accounts where either BillingCountry or AnnualRevenue is null.

Examples:

Input: (no parameters - queries all accounts) Output: {'USA' => 250000, 'Germany' => 12000000, 'Japan' => 8900000, ...} Explanation: Returns Map with each country as key and minimum annual revenue as value Input: (no parameters - queries all accounts) Output: Map with multiple countries and their minimum revenue values Explanation: Only countries with at least one non-null AnnualRevenue are included
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 account

How 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

Contest Alert

🏆 #CodeEveryDay Jan 2026

Contest runs January 1 - 31. Complete challenges to climb the leaderboard!

Points are calculated for challenges completed during the contest period.