题解 | #未完成率较高的50%用户近三个月答卷情况#

未完成率较高的50%用户近三个月答卷情况

http://www.nowcoder.com/practice/3e598a2dcd854db8b1a3c48e5904fe1c

with sql_id as
(select *from (
    select 
        a.*,
        @row_num:=@row_num+1 as row_num 
    from 
        (
     select uid,incomplete_rate,
     row_number() over(order by incomplete_rate desc) as incomplete_rank from
        (select uid,
        count(submit_time) as complete_cnt,
        count(start_time) as total_cnt,
        1-count(submit_time)/count(start_time) as incomplete_rate
        from
        exam_record er
        left join examination_info ei
        on er.exam_id=ei.exam_id
        where ei.tag='SQL'
        group by uid) a
     order by incomplete_rate desc
 
)
 a , (select @row_num:=0) b  
    order by 
        incomplete_rank
) base
where 
    base.row_num <= ceiling(@row_num*0.5)
)

select uid,start_month,
count(start_month) as total_cnt,
count(submit_time) as complete_cnt 
from
(select er.uid,er.exam_id,submit_time,SUBSTR(DATE_FORMAT(start_time,'%Y%m%d'),1,6) as start_month,
DENSE_RANK() OVER(PARTITION BY uid ORDER BY YEAR(start_time) desc,MONTH(start_time) DESC) as month_rank
from exam_record er
left join user_info ui
on er.uid=ui.uid
where ui.level=6 or ui.level=7) a
where month_rank<=3 and uid IN (select uid from sql_id)
group by uid,start_month
order by uid,start_month

全部评论

相关推荐

点赞 评论 收藏
分享
11-09 14:54
已编辑
华南农业大学 产品经理
大拿老师:这个简历,连手机号码和照片都没打码,那为什么关键要素求职职位就不写呢? 从上往下看,都没看出自己到底是产品经理的简历,还是电子硬件的简历? 这是一个大问题,当然,更大的问题是实习经历的描述是不对的 不要只是去写实习流程,陈平,怎么去开会?怎么去讨论? 面试问的是你的产品功能点,是怎么设计的?也就是要写项目的亮点,有什么功能?这个功能有什么难处?怎么去解决的? 实习流程大家都一样,没什么优势,也没有提问点,没有提问,你就不得分 另外,你要明确你投的是什么职位,如果投的是产品职位,你的项目经历写的全都是跟产品无关的,那你的简历就没用 你的面试官必然是一个资深的产品经理,他不会去问那些计算机类的编程项目 所以这种四不像的简历,在校招是大忌
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务