ForceChallenges
ProblemsDailyNotes
Sign in
Problem list
Sign in to submit

Accounts With More Than Five Contacts

HardSOQL 50 ptsCreated Oct 7, 2026

Find accounts with more than five contacts.

Example

AccountIdtotal
001A6

Constraints

  • Use GROUP BY and HAVING.
GROUP BYHAVINGCOUNT
CodeSOQL
Loading editor…
+1 hidden on submit
visible

Seed data

Account× 2 rows
Name: Account {{i}}
Contact× 12 rows
LastName: Contact {{i}}AccountId: {{id:Account:i%2+1}}

Expected

2 row(s), order checked

#totalAccountId
16001000000000002AAA
26001000000000001AAA