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