select uid,max(days_window) as days_window ,round(max(days_window)*max(sum_exam_cnt)/(1+timestampdiff(day,max(min_day),max(max_day))),2) as avg_exam_cnt from ( select uid ,max(days_window)over(partition by uid order by days_window desc) as days_window ,count(exam_id) over(partition by u...