On page 40 of the book:
<quote>
In the employee table, manager_id is a nullable column. Intuitively, the
following queries should return the value 107 - the number of rows in
the employee table - but instead they return the value 106 because one
record doesn't contain a value for department_id:
SELECT COUNT(*) FROM employees WHERE manager_id=100 OR manager_id!=100;
SELECT COUNT(*) FROM employees WHERE manager_id = manager_id;
SELECT COUNT(*) FROM employees WHERE manager_id != -1
To obtain the answer, you need to add the clause OR manager_id IS NULL ...
</quote>
Note the reference to the department_id in the initial paragraph. This should
have been manager_id.
Looking only at the earlier given CREATE statement for the employee table, department_id is a FK and does not have any direct relationship to the manager_id
value. Additionally the department_id column does not logically make sense in the context of the queries and write up around it.