Show all the names for each account.
select name from accounts
What are the unique set of names?
select distinct name from accounts
How many savings accounts under each of these names?
select count(*), t1.name from accounts as t1 join savings as t2 on t1.custid = t2.custid group by t1.name
How about checking accounts?
select count(*), t1.name from accounts as t1 join checking as t2 on t1.custid = t2.custid group by t1.name