Get 2 counts in single query I need to get count of 2 columns with group by



This is my sample data 

I need to get count of persons from particular state and count of persons from particular country 

My output should be like



I need to manipulate data like this; how to create query for this
SELECT country, 
       COUNT(state) total,
       SUM(state='xxx') xxx,
       SUM(state='yyy') yyy,
       SUM(state='zzz') zzz
FROM table
GROUP BY country