# Accounts Without Opportunities

**Type:** SOQL · **Difficulty:** Medium · **Topics:** Semi-join, Anti-join

Practice this problem interactively (write and run your SOQL against realistic data): https://www.forcechallenges.com/problems/accounts-without-opportunities

## Problem

**Scenario**
The sales team is hunting for white space: customers and prospects that nobody has sold to yet. Before planning outreach, they want a clean list of Accounts that have never had any Opportunity created, whatever its stage.

**Task**
Write one SOQL query on `Account` that returns every Account that has **no Opportunities at all**. An Account that has only closed, lost or old Opportunities still counts as having Opportunities and must not be returned.

Note that your data may also contain Opportunities that are not linked to any Account. They do not affect which Accounts qualify.

**Expected output**
One row per Account with two columns: `Id` and `Name`. Row order is not checked.

**Example**
- Acme has two Opportunities. It is excluded.
- Globex has a single Closed Lost Opportunity. It is excluded, because it still has an Opportunity.
- Initech has no Opportunities. It is returned.
- Umbrella has no Opportunities. It is returned.

Result: Initech and Umbrella (each with its `Id` and `Name`).

## Constraints

Return exactly `Id` and `Name`. Use an anti-join (WHERE Id NOT IN (SELECT AccountId FROM Opportunity)). Row order is not checked.

---
Source: ForceChallenges · last updated 2026-10-24
