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. From the following table, write a SQL query to find those job titles where the difference between minimum and maximum salaries is in the range the range 12000, 18000 (Begin and end values are included.). Return job_title, max_salary-min_salary.
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)
Relational Algebra Expression:
Relational Algebra Tree:
Contribute your code and comments through Disqus.
Previous: From the following table, write a SQL query to compute the average salary of each job ID. Exclude those records where average salary is higher than 8000. Return job ID, average salary.
Next: From the following table, write a SQL query to find those employees whose first name or last name starts with the letter ‘D’. Return first name, last name.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
SQL: Tips of the Day
MySQL export schema without data
mysqldump -h yourhostnameorIP -u root -p --no-data dbname > schema.sql
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework