I'm rather new to Oracle. I'm in first semester of it.
I'm trying to display a list of employee IDs, salaries, department IDs and the department name in which the employees work. If an employee is not currently assigned to a department, they must still be on the list.
This is what I have:
SELECT e.employee_id, e.salary, NVL(e.department_id, '0'), dep.department_name
FROM employees e, departments dep
WHERE e.department_id = dep.department_id
ORDER BY e.employee_id;
The Employees table has the department ID on it, and so does the Department table. I'm supposed to receive 20 results, but instead I'm only receiving 19.
Any help would be much appreciated.