﻿ SQL SORTING and FILTERING on HR: Display the job ID for those jobs which average salary is above 8000 - w3resource

# 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

Sample Solution:

``````SELECT job_title, max_salary-min_salary AS salary_differences
FROM jobs
WHERE max_salary BETWEEN 12000 AND 18000;
``````

Sample Output:

```      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:

## Query Visualization:

Duration:

Rows:

Cost:

Contribute your code and comments through Disqus.

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
```

Ref: https://bit.ly/3xzB9dS