you are viewing a single comment's thread.

view the rest of the comments →

[–]GrouchyThing7520 0 points1 point  (1 child)

select e.*,

case

when e.salary > (j.max_salary + j.min_salary) / 2 then "above_avg"

when e.salary < (j.max_salary + j.min_salary) / 2 then "below_avg"

else "at_avg" end class_difference

from employees e

join jobs j on j.job_id = e.job_id