I think this should do it:
select year(admit_date) as year_of_admit, sum(case when gender='Male' then 1 else 0 end)*100/count(*) as Male, sum(case when gender='Female' then 1 else 0 end)*100/count(*) as Female, sum(case when homeless='Yes' then 1 else 0 end)*100/count(*) as Homeless from client group by year(admit_date)
I do not know if you can have values โโother than Men / Women, or Yes / No, for example, "unknown." In this case, you will need to decide whether, for example, 10 men, 5 women and 5 unknowns - 50% of men, that is, 50%, as you know, men or 66% of men, that is 66% of those whose gender is known are men.
source share