SQL SORTING and FILTERING on HR Database: Display job Title, the difference of minimum and maximum salaries for those jobs which max salary between 12000 to 18000
SQL SORTING and FILTERING on HR Database: Exercise-35 with Solution
35. Write a query in SQL to display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000.
Sample table : jobs
SELECT job_title, max_salary-min_salary AS salary_differences FROM jobs WHERE max_salary BETWEEN 12000 AND 18000;
job_title | salary_differences ----------------------+-------------------- Finance Manager | 7800 Accounting Manager | 7800 Sales Representative | 6000 Purchasing Manager | 7000 Marketing Manager | 6000 (5 rows)
Contribute your code and comments through Disqus.
Previous: Write a query in SQL to display the job ID for those jobs which average salary is above 8000.
Next: Write a query in SQL to display all those employees whose first name or last name starts with the letter D.
What is the difficulty level of this exercise?