Development questions

How would you list Contact-only Accounts, meaning Accounts with Contacts but zero Opportunities, using one SOQL query?

DevelopmentMediumCognizantDeloitteEY

Pair a semi-join on Contact with an anti-join on Opportunity in the same WHERE clause. This finds Contact-only Accounts: those with at least one Contact and zero Opportunities.

soql
SELECT Id, Name FROM Account
WHERE Id IN (SELECT AccountId FROM Contact)
  AND Id NOT IN (SELECT AccountId FROM Opportunity)
soqlscenariosemi-joinanti-join