w3resource
SQL exercises

SQL exercises on employee Database: List the employees in ascending order of designations of those, joined after the second half of 1991

SQL employee Database: Exercise-81 with Solution

[An editor is available at the bottom of the page to write and execute the scripts.]

81. Write a query in SQL to list the employees in ascending order of designations of those, joined after the second half of 1991.

Sample table: employees


Sample Solution:

SELECT *
FROM employees
WHERE hire_date>('1991-6-30')
  AND date_part('year',hire_date)=1991
ORDER BY job_name ASC;

Sample Output:

 emp_id | emp_name | job_name  | manager_id | hire_date  | salary  | commission | dep_id
--------+----------+-----------+------------+------------+---------+------------+--------
  69062 | FRANK    | ANALYST   |      65646 | 1991-12-03 | 3100.00 |            |   2001
  69000 | JULIUS   | CLERK     |      66928 | 1991-12-03 | 1050.00 |            |   3001
  68319 | KAYLING  | PRESIDENT |            | 1991-11-18 | 6000.00 |            |   1001
  66564 | MADDEN   | SALESMAN  |      66928 | 1991-09-28 | 1350.00 |    1500.00 |   3001
  68454 | TUCKER   | SALESMAN  |      66928 | 1991-09-08 | 1600.00 |       0.00 |   3001
(5 rows)

Practice Online


Sample Database: employee

employee database structure

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to list the employee id, name, hire_date, current date and experience of the employees in ascending order on their experiences.
Next: Write a query in SQL to list the total information of employees table along with department, and location of all the employees working under FINANCE and AUDIT in the ascending department no.

What is the difficulty level of this exercise?