w3resource
SQL exercises

SQL SORTING and FILTERING on HR Database: Display the details of jobs in descending sequence on job title

SQL SORTING and FILTERING on HR Database: Exercise-27 with Solution

27. Write a query in SQL to display the details of jobs in descending sequence on job title.

Sample table : jobs


Sample Solution:

SELECT * 
	FROM jobs 
		ORDER BY job_title;

Sample Output:

   job_id   |            job_title            | min_salary | max_salary
------------+---------------------------------+------------+------------
 FI_ACCOUNT | Accountant                      |       4200 |       9000
 AC_MGR     | Accounting Manager              |       8200 |      16000
 AD_ASST    | Administration Assistant        |       3000 |       6000
 AD_VP      | Administration Vice President   |      15000 |      30000
 FI_MGR     | Finance Manager                 |       8200 |      16000
 HR_REP     | Human Resources Representative  |       4000 |       9000
 MK_MAN     | Marketing Manager               |       9000 |      15000
 MK_REP     | Marketing Representative        |       4000 |       9000
 AD_PRES    | President                       |      20000 |      40000
 IT_PROG    | Programmer                      |       4000 |      10000
 AC_ACCOUNT | Public Accountant               |       4200 |       9000
 PR_REP     | Public Relations Representative |       4500 |      10500
 PU_CLERK   | Purchasing Clerk                |       2500 |       5500
 PU_MAN     | Purchasing Manager              |       8000 |      15000
 SA_MAN     | Sales Manager                   |      10000 |      20000
 SA_REP     | Sales Representative            |       6000 |      12000
 SH_CLERK   | Shipping Clerk                  |       2500 |       5500
 ST_CLERK   | Stock Clerk                     |       2000 |       5000
 ST_MAN     | Stock Manager                   |       5500 |       8500
(19 rows)

Practice Online


HR database model

Query Visualization:

Duration:

Query visualization of Display the details of jobs in descending sequence on job title - Duration

Rows:

Query visualization of Display the details of jobs in descending sequence on job title - Rows

Cost:

Query visualization of Display the details of jobs in descending sequence on job title - Cost

Contribute your code and comments through Disqus.

Previous: Write a query in SQL to display the manager ID and number of employees managed by the manager.
Next: Write a query in SQL to display the first and last name and date of joining of the employees who is either Sales Representative or Sales Man.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming