Let's say I have two existing tables, "dogs" and "cats":
dog_name | owner
---------+------
Sparky | Bob
Rover | Bob
Snoopy | Chuck
Odie | Jon
cat_name | owner
---------+------
Garfield | Jon
Muffy | Sam
Stupid | Bob
How do I write a query with this output?
owner | num_dogs | num_cats
------+----------+---------
Bob | 2 | 1
Chuck | 1 | 0
Sam | 0 | 1
Jon | 1 | 1