Errata

Mastering Oracle SQL

Errata for Mastering Oracle SQL

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page ch8
table Employee

Suggestion:Add , how records will be inserted into table which has PK and FK are present in the same table.

In the chapter Hirerarchical Queries(chapter 8), one table(Employee) is mentioned with PK and FK are present in the same table.

In that example description, it is not mentioned, how data to be inserted in the table as PK and FK are present in the same table. while doing practical, i face hurdle, then i released that, the value in PK column has to be present, only then the same value can be inserted into FK column.

Anonymous  Oct 02, 2013 
Printed Page 1
mosql2_data.sql

no data in LINE_ITEM table

Anonymous   
Printed Page 5
Figure 1-1

Please refer the url below for the example.
http://examples.oreilly.com/mastorasql2/mosql2_data.sql

Error1:-
If you run the above script, it does not generate the part distributor model as mentioned in chapter 1 figure 1-1.

The foreign key and primary key contraints are missing in the script, hence only standalone tables are created.

Error2:
In the part distributor model, refer the diagram for the relationship between the employee and employee comment table, the association cardinality from employee to employee_comment is many to 1.

The actual cardinality should be 1(Employee) to Many(employee_comment) as per the foreign key contraint on the employee_comment table, refer the diagram in figure 1-1 chapter 1 page 5.

Please check the above errors.

Thanks in advance.
Rhushikesh.

Rhushikesh Velankar  May 23, 2009 
Printed Page 54
bottom of page

the select statement within the view should not include: "c.salesperson_id"

Anonymous   
Printed Page 83
The first paragraph under the query

The paragraph reads:

SELECT fname, lname
FROM employee
WHERE dept_id = 30 AND salary >= ALL
(SELECT salary
FROM employee
WHERE dept_id = 30);

The subquery returns the set of salaries for department 30, and the containing query checks each employee in the department to see if her salary is greater OR equal to every salary returned by the subquery.

Here is where the problem is:

Look at at the query it reads: WHERE dept_id = 30 AND salary >= ALL

So it is using an AND, and not an OR

but in the paragraph describing language it is refering it to as an OR, should that be changed to an AND ?

Anonymous   
PDF Page 110
Text in the middle of the page

The parenthetical statement says:

(If you do not wish to have gaps in the ranking, you
can use the DENSE_RANK function intead.)

The word "instead" is misspelled as "intead".

txblackbird  Feb 10, 2017 
Printed Page 174
1st paragraph

The alias "c1" is missing for the customer_known_good table.

Anonymous   
Printed Page 174
1st paragraph

The alias "c1" is missing for the customer_known_good table.

Anonymous  Aug 06, 2008 
PDF Page 174
Code block at the top of the page.

In this code block:

(SELECT c1.*,COUNT(*)
FROM customer_known_good
GROUP BY c1.cust_nbr, c1.name...
MINUS
SELECT c2.*, COUNT(*)
FROM customer_test c2
GROUP BY c2.cust_nbr, c2.name...)
UNION ALL
(SELECT c3.*,COUNT(*)
FROM customer_test c3
GROUP BY c3.cust_nbr, c3.name...
MINUS
SELECT c4.*, COUNT(*)
FROM customer_known_good c4
GROUP BY c4.cust_nbr, c4.name...)

it is obvious that customer_known_good should be aliased as c1 but it is not shown as being aliased.

Jeff Williams  Feb 23, 2017 
PDF Page 241
2nd Paragraph

The "than" in the following sentence should be "then".

If you can reliably provide additional information regarding the partition keys, than you should do so;

This sentence is about the middle of the paragraph.

Jeff Williams  Feb 24, 2017 
Printed Page 357
Code at top of page and description in bullet point 1.

Code says:
FROM job j LEFT OUTER JOIN employee e ON e.job_id = j.job_id

Bullet says:
1. Connect an outer join from employee to job with employee as the required table.

This is in direct conflict with page 43 para 4 "In each case, the directional word, either LEFT or RIGHT, points toward the anchor table, the table that is required."

Also the example at the bottom of page 42 in bold is a bit confusing when the first example on 43 is the other way around...

Anonymous   
Printed Page 374
last paragraph

The insert statement should be:

insert into line_item
(order_nbr, part_nbr, qty)
select 7101, extractValue(extract(itm.column_value, '/item/part_number'),'/part_number'),
extractValue(extract(itm.column_value,'/item/quantity'),'/quantity')
from table(select xmlsequence(extract(po.purchase_order_doc,
'/purchase_order//item'))
from purchase_order po
where po.po_id = 1000) itm;

George Curran  Dec 29, 2008 
Printed Page 383
4th paragraph xmlelement parent/child example

The provided example suggests the below code to generate XML

SELECT XMLElement("supplier",
XMLElement("supplier_id", s.supplier_id)||XMLElement("name", s.name)
) xml_fragment
FROM supplier s;

Using || (on line 2 of script) generates
<supplier>&lt;supplier_id&gt;1&lt;/supplier_id&gt;&lt;name&gt;Acme Industries&lt;/name&gt;</supplier>
which is incorrect xml format

instead repacing || with "," comma yields ethic output.
example
SELECT XMLElement("supplier",
XMLElement("supplier_id", s.supplier_id),XMLElement("name", s.name)
) xml_fragment
FROM supplier s;
<supplier><supplier_id>1</supplier_id><name>Acme Industries</name></supplier>

I am using oracle 10g. Please feel free to let me know your updates.

Thanks
Abanikant

Abanikant  Aug 18, 2012