select customer_tb.pay_ability, 
concat(round((count(distinct case when loan_tb.overdue_days is not null then loan_tb.customer_id end)/count(distinct customer_tb.customer_id))*100,1),'%') as overdue_ratio
from loan_tb 
join customer_tb on loan_tb.customer_id = customer_tb.customer_id

group by customer_tb.pay_ability
order by overdue_ratio desc