I'm sorry, but that query makes no sense.
???? That is an *IMPOSSIBLE* condition. It will *ALWAYS* be FALSE.
ON E.id=ED.emp_id AND ED.emp_id <> E.id
Because you are asking for ED.emp_id to *BOTH* be EQUAL *AND* NOT EQUAL to E.id.
So there will never be any matches in the EmpDepts table.
As to why you then get *ALL* employees:
By definition, a LEFT JOIN will show you all the records in the left-side table. That is, in your query, all the records in the EMPLOYEES table.
That's the whole reason to use a LEFT JOIN: You *WANT* all the records from the left side table, whether or not there is a matching record in the right side table.
*THIS* is what you need, I think:
SELECT E.id, E.last_name
FROM Employees E LEFT JOIN EmpDepts ED
ON E.id = ED.emp_id
WHERE ED.emp_id IS NULL