题解 | 完成员工考核试卷突出的非领导员工

select
    ein.emp_id emp_id,
    emp_level,
    tag
from
    test.examination_info ei
    join test.exam_record er on ei.exam_id = er.exam_id
    join test.emp_info ein on ein.emp_id = er.emp_id
    join (
        select
            er.exam_id,
            round(sum(score) / count(score), 3) 平均分,
            round(
                avg(timestampdiff (second, start_time, submit_time)) / 60,
                1
            ) 平均用时
        from
            test.examination_info ei
            join test.exam_record er on ei.exam_id = er.exam_id
            join test.emp_info ein on ein.emp_id = er.emp_id
        group by
            exam_id
    ) a on ei.exam_id = a.exam_id
where
    emp_level < 7
    and score > 平均分
    and timestampdiff (second, start_time, submit_time) / 60 < 平均用时
order by
    ein.emp_id asc

全部评论

相关推荐

05-19 15:21
已编辑
华南农业大学 Java
白火同学:你才沟通了200,说实话,北上广深杭这里面你连一座城市的互联网公司都没投满呢,更别说还有各种准一线二线城市了。等你沟通突破了三位数,还没结果再考虑转行的事吧。
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-01 11:47
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务