select
branch as howoldAreyou,
count(0) as cat,
sum(case when ifnull(t.BirthDate, CURDATE() - 1) > ifnull(t.DeadDate, CURDATE()) then 1 end) as dog,
count(case when ifnull(t.BirthDate, CURDATE() - 1) <= ifnull(t.DeadDate, CURDATE()) then 1 end) as bird
from table_fine as t
group by branch