本题难点在于求中位数所在区间
中位数所在区间为最大正序数与最大逆序数均>=二分之一总序数的区间
select grade FROM (select grade,(select sum(number) from class_grade) t
,sum(number) over(order by grade) a
,sum(number) over(order by grade desc) b
from class_grade ) t1
WHERE a>=t/2 and b>=t/2
order by grade