programming-examples/sql/JoinHRDatabase/14. Write a query in SQL to display job title, full name (first and last name ) of employee, and the difference between maximum salary for the job and salary of the employee.sql

6 lines
349 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*14. Write a query in SQL to display job title, full name (first and last name ) of employee, and the difference between
maximum salary for the job and salary of the employee.*/
SELECT job_title, first_name || ' ' || last_name AS Employee_name,
max_salary-salary AS salary_difference
FROM employees
NATURAL JOIN jobs;