Accounts that DO NOT have any Contacts:
Select Id, Name From Account Where Id NOT IN (Select AccountId From Contact)
Accounts that do have at least 1 Contact:
Select Id, Name From Account Where Id IN (Select AccountId From Contact)
Accounts that DO NOT have any Contacts:
Select Id, Name From Account Where Id NOT IN (Select AccountId From Contact)
Accounts that do have at least 1 Contact:
Select Id, Name From Account Where Id IN (Select AccountId From Contact)