SOQL Query For Accounts With Contacts & Without Contacts

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)