select
    emp_no,
    first_name,
    last_name,
    btype,
    salary,
    (
        case
            when btype=1 then salary*0.1
            when btype=2 then salary*0.2
            else salary*0.3
        end
    ) as bonus
from
    emp_bonus
    left join employees using(emp_no)
    left join salaries using(emp_no)
where
    to_date='9999-01-01'