题解 | #获取有奖金的员工相关信息。#

获取有奖金的员工相关信息。

https://www.nowcoder.com/practice/5cdbf1dcbe8d4c689020b6b2743820bf

select
    t1.emp_no,
    t1.first_name,
    t1.last_name,
    t3.btype,
    t2.salary,
    round(
        case
            t3.btype
            when 1 then t2.salary * 0.1
            when 2 then t2.salary * 0.2
            else t2.salary * 0.3
        end,
        1
    ) as bonus
from
    employees t1
    join salaries t2 on t1.emp_no = t2.emp_no
    join emp_bonus t3 on t1.emp_no = t3.emp_no
where
    t2.to_date = '9999-01-01'
order by
    t1.emp_no

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-24 13:35
点赞 评论 收藏
分享
码砖:求职岗位要突出,一眼就能看到,教育背景放到最后,学校经历没那么重要,项目要重点突出
点赞 评论 收藏
分享
零OFFER战士:另一个版本查看图片
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-25 17:51
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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