Explain solution please
There is this sql question: An employee is a manager if any other employee has their managerId set to the first employees id. An employee who is a manager may or may not also have a manager. TABLE employees id INTEGER NOT NULL PRIMARY KEY managerId INTEGER REFERENCES employees(id) name VARCHAR(30) NOT NULL Write a query that selects the names of employees who are not managers. The solution I found was: select name from employees where id not in(select managerId from employees where managerid is not null); I cannot see why the 'where managerid is not null' part is necessary? Surely it would only make a difference if the id's were ever null, but they are not. Could someone please explain? Also, why does Select name from employees where id <> managerid; not work?