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

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

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

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

全部评论

相关推荐

不愿透露姓名的神秘牛友
03-19 10:38
实力求职者:真的绷不住了,第一张霸总人设,第二张求生欲拉满
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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