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

Return an alphabetically sorted list of Account names that have at least one Closed Won opportunity. Use a SOQL subquery to find only accounts with winning opportunities. The IsWon field is true when StageName is Closed Won.

Examples:

Input: (no parameters - queries from org) Output: [Account Alpha, Beta Corp, Gamma Inc, ...] Explanation: Returns sorted names of accounts with at least one Closed Won opportunity Input: (varies by org) Output: [] Explanation: Returns empty list if no accounts have won opportunities
Apex Code Editor

Welcome to Lightning Challenge!

How It Works

  • • Write your solution in the code editor
  • • This challenge runs without connecting your own org
  • • Submit to check if your solution passes
  • • Use hints if you get stuck

Contest Alert

🏆 #CodeEveryDay August 2026

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

Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In