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

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

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

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

全部评论

相关推荐

04-14 20:10
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务