You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a query that calculates the difference between the highest salaries found in the marketing and engineering departments. Output just the absolute difference in salaries.
Tables: db_employee, db_dept
db_employee
Preview
id:
int
first_name:
varchar
last_name:
varchar
salary:
int
department_id:
int
db_dept
Preview
id:
int
department:
varchar
SELECT (
MAX(CASE WHEN department = 'marketing' THEN salary END)
-
MAX(CASE WHEN department = 'engineering' THEN salary END)) AS salary_difference