w3resource
SQL exercises

SQL exercises on employee Database: List the employee name, and job_name who are not working under a manager

SQL employee Database: Exercise-26 with Solution

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

26. Write a query in SQL to list the employee name, and job_name who are not working under a manager.

Sample table: employees


Pictorial Presentation:

SQL exercises on employee Database: List the employee name, and job_name who are not working under a manager

Sample Solution:

SELECT e.emp_name,
       e.job_name
FROM employees e
WHERE manager_id IS NULL;

Sample Output:

 emp_name     | job_name
--------------+--------------
  KAYLING     | PRESIDENT

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 name, id, hire_date, and salary of all the employees joined before 1 apr 91.
Next: Write a query in SQL to list all the employees joined on 1st may 91.

What is the difficulty level of this exercise?