题解 | #获取有奖金的员工相关信息。#
获取有奖金的员工相关信息。
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
