with staff_overtime as ( select staff_id, first_clockin, last_clockin from attendent_tb as a where (timestampdiff(minute, a.first_clockin, a.last_clockin)/60) > 9.5 ) select distinct sn.department as department, concat(round(sum(if(so.staff_id is not null, 1, 0)) * 100 / count(sn.staff_id), 1), '...