typo - wrong column name used in explanation

36 views
Skip to first unread message

Ligaya Turmelle

unread,
Jan 5, 2016, 9:28:39 AM1/5/16
to Beginning Oracle Database 12c Administration
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.

Iggy Fernandez

unread,
Jan 5, 2016, 9:56:08 AM1/5/16
to Beginning Oracle Database 12c Administration
Absolutely correct! I will add your correction to the Errata section on the Apress website with credit to you.
Reply all
Reply to author
Forward
0 new messages