ForceChallenges
ProblemsDailyNotes
Sign in
Problem list
Sign in to submit

Largest Opportunity per Account

HardSOQL 50 ptsCreated Oct 9, 2026

Solve the business requirement using SOQL.

Return the requested records or aggregate groups, preserving the required filters and ordering.

Constraints

Use the SOQL features named in the tags. Return the required fields and ordering.

Nested SubqueryLIMITSemi-Join
CodeSOQL
Loading editor…
+3 hidden on submit
visible

Seed data

Account× 5 rows
Name: Account {{i}}
Opportunity× 20 rows
Name: Deal {{i}}Amount: {{i*100000}}AccountId: {{id:Account:i%5+1}}CloseDate: {{date:-i}}StageName: Proposal

Expected

5 row(s), any order

#IdNameOpportunities
1001000000000001AAAAccount 1[1 record]
2001000000000002AAAAccount 2[1 record]
3001000000000003AAAAccount 3[1 record]
4001000000000004AAAAccount 4[1 record]
5001000000000005AAAAccount 5[1 record]