programming-examples/sql/JoinHRDatabase/10. Write a query in SQL to display the first name, last name, department number and name, for all employees who have or have not any department.sql

6 lines
328 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*10. Write a query in SQL to display the first name, last name, department number and name, for all employees who have or have
not any department.*/
SELECT E.first_name, E.last_name, E.department_id, D.department_name
FROM employees E
LEFT OUTER JOIN departments D
ON E.department_id = D.department_id;