with rk_table as (select grade, sum(number) over(order by grade) t_rank from class_grade), start_end as (with total_table as (select sum(number) as total from class_grade) select case when total % 2 = 0 then floor(total / 2) else floor(total / 2) + 1 end start, floor(total / 2) + 1 end from total_ta...