Errata

For O'Neil and O'Neil, Database Principles, Programming and Performance, Second Edition  To determine the printing for your book, look at the sequence of numbers under the copyright notice on the page facing the Foreword.  

5 4 3 2 1 means first printing (2000)  This printing needs all the errata listed here.

5 4 3 2    means second printing (spring, 2001)  This printing only needs the "Errata for second printing".

To submit new errata

Errata for second printing

Chapter 2

Page 68, last line of boxed region at the top of the page: 

JN(A2 > B2 )  --> JN(A1 > B2 )  

Page 71, Example 2.10.1, on both lines 3 and 5 of this example:

ORDERS.qty > PRODUCTS.quantity  --> ORDERS.qty > PRODUCTS.quantity and ORDERS.pid = PRODUCTS.pid

Chapter 3

Page 117, Figure 3.11, add after line 4, an additional form for tableref syntax:
| (tableref)

Page 118, Example 3.6.3: add "distinct" to query

Page 123, line 9 from bottom: "group functions" now "aggregate functions"
Oracle speaks of group --> Oracle speaks of aggregate

Page 141, line 4 of Figure 3.19, add "|SOME" to "ALL|ANY"

Chapter 5

Page 299, line 10 of code at top of page, add curly brace:

else  -->  } else

Chapter 7

Page 420, line 2

secondary  --> foreign

Page 425, line 3: drop comma:

{, corr_def_name  --> { corr_def_name

Page 427, line 3 of Figure 7.11 and line 3 of Figure 7.12, drop comma:

{, corr_def_name  --> { corr_def_name

Page 432, Example 7.1.7, for Oracle, drop "row" in "referencing old row".

Page 449, line 14 from bottom of page:

CONSTRAINT_DEFS  --> USER_CONSTRAINTS

Page 457

[7.5] (a) (ii) 

pid = 'c001'   --> pid = 'p01'

Chapter 8

Page 482, lines 4 and 6 after the table at the top of the page, add a B to BBBBB in two places:

OOOOOOFFFBBBBBRRR --> OOOOOOFFFBBBBBBRRR

BBBBB --> BBBBBB

Page 527, [8.1], line 3, drop commas in storage clause:

(initial 20480, next 20480, maxextents 8, minextents 3, pctincrease 0)

-->(initial 20480 next 20480 maxextents 8 minextents 3 pctincrease 0)

Page 531, [8.12], line 3 from bottom:

with value 1  -> with lineno 1.

Chapter 9

Page 579, line 19:

data scan of 2500 seconds  --> data scan of 1250 seconds

Page 586, last line:

IT1 requires 10 seconds  --> IT1 requires 5 seconds

Page 623, [9.2](c)(iii), add "distinct": 

how many index leaf pages  --> how many distinct index leaf pages 

Chapter 10

Page 681, line 4. of ROLLBACK:

List of active transactions  --> List of active uncommitted transactions

Page 681, line 7. of ROLLBACK

List of active transactions  --> List of active uncommitted transactions

Appendix A

Page 724, lines 4-7 from bottom, 4 times:

sqlload --> sqlldr

Appendix B

Page 739, Figure B.3, lines 5 and 6, change "int" to "size_t".  Also add "#include <stdio.h>" as the new second line.

Solutions to Selected Exercises

Page 807, [7.10](a), line 17, replace misleading sentence:

We allow this. --> The database system could allow this but Oracle does not.

Page 813, [9.6](a), line 2, drop "below the absolute maximum of 16 million."

[9.6](c)

above the absolute maximum for RID lists, so it is not possible.

-->

four times the size in (a), so 80Mbytes, and thus a RID pool of 160M is needed, and a 320M buffer pool.

Page 814, [9.8](a) Drop the answer (obsolete.)  25 million RIDs would take 100Mbytes of RID pool space, and must not take over 50% of the RID pool, so the pool must be at least 200Mbytes.

 

 

Solutions to Selected Exercises: Chapter 9

[9.13](b) The calculation ignores the cost of the K100 index access to determine the B2 rows.  Add after "above 100,000 in value.)":

The K100K index accesses used to determine these B2 rows cost 4000 R for the in-range cases (each too small to count as sequential), and at most 1 R for all the out-of-range accesses to the end of the index (i.e., negligible.)

Change the last line of the first paragraph as follows:

10S + 50,000 L = 50,000/100 = 500 seconds -> 10 S +  4000 R + 50,000 L = 50,000/100 + 4000/40 = 600 seconds

Change the 9th line of the second paragraph as follows:

K100K index  -> K250K index

 

Errata for first printing (these are fixed in the book's second printing)

Preface

We would also like to acknowledge the excellent work of the editors at Morgan Kaufman, Diane Cerra, Belinda Breyer, and Cheri Palmer, and others.

Chapter 1

Page 17, Figure 1.10, add second parenthesis at end of statement:

class <= 4);   -> class <= 4));

Chapter 3

Page 105, Example 3.4.13, add "distinct" to second select:

select c.cname -> select distinct c.cname

Page 117, Figure 3.11, add curly braces before "ON":

ON search_condition -> {ON search_condition

Chapter 4

Page 189, Example 4.2.16, first line of select:

select pol_person.lname -> select p.pol_person.pname.lname

Page 194, Example 4.2.22, second select:

select value(p) -> select p

Page 195, Example 4.2.24, update statement:

,null) -> , cast(null as char(1)))

Page 195, Example 4.2.24, last insert statement:

pname.minitial -> pname.mi

Page 209, Example 4.3.9, last line, remove extra parenthesis:

d2)); -> d2);

Page 209, Example 4.3.10, second to last line, remove extra parenthesis:

dependents)) -> dependents)

Page 211, Example 4.3.12, first line of select statement, add .pname:

select pb.phperson.fname -> select pb.phperson.pname.fname

Page 214, Example 4.3.15, last line, add table alias pb and change eid to match on ssno:

update phonebook -> update phonebook pb

where eid = 101; -> where pb.phperson.ssno = 123897766;

Page 227, Example 4.4.3, add a declaration for custcity, on the line after "custname char(20);"

custcity char(20);

Page 228, Example 4.4.4, reverse the order of name and type in the function parameter:

inc_age(person_t x) -> inc_age(x person_t)

Page 232, Example 4.4.7, last select statement:

where r.inside(p) -> where r.inside(value(p))

Page 234, Example 4.4.9, second select statement, add "> 0":

and r.inside(value(p)) -> r.inside(value(p)) > 0

Page 235, Example 4.4.10, replace "integer" with "int" in the wordcount function definition (integer does not match int of the declaration, surprisingly enough)

wordcount return integer is -> wordcount return int is

Page 236, Example 4.4.11, add spaces between docname and varchar(40), between docauthor and person_t, and between keywords and wordset_t. Also add ".words" to the nested table clause:

nested table keywords -> nested table keywords.words

Page 242, Example 4.4.18, add "define" twice and drop the "begin":

custname char(20); -> define custname char(20);

custcity char(20); -> define custcity char(20);

begin   -> 

Page 243, Example 4.4.20, add "nper." to age:

let nper.age = age + 1; -> let nper.age = nper.age + 1;

Page 246, Example 4.4.24, in create table statement, add "type":

documents of document_t -> documents of type document_t

Chapter 5

Page 285, Figure 5.7 should be replaced by Figure C.33, page 773, and Figure 5.8 by Figure C.34, to make this update syntax more general.  The following corrections make the figures agree, if you use the first substitution twice and the second substitution a total of four times.

tablename -> [schema.]tablename

columnname = expr -> columnname = expr|NULL|(subquery)

Chapter 7

Page 441, in the create table command:

foreign key (cid) -> foreign key (custid)
foreign key (aid) -> foreign key (agentid)
foreign key (pid) -> foreign key (prodid)

Chapter 8

Page 478, Figure 8.5, second line, add one more dot to make an ellipsis.

Page 482, on the line above "select cname...", replace 44 with 45:

+44*64 -> + 45*64

Page 485, Figure 8.7, line 2, add ellipsis:

DESC]}) -> DESC]...})

Page 492, 7 lines from the bottom of the page:

no longer need the separator 65; the separator 55
->
no longer need the separator 88, the separator 62

Page 523, line 13, replace "P" by "1-P":
…and then an empty slot in the third with probability P
->
…and then an empty slot in the third with probability 1-P

Chapter 9

Page 624, problem 9.3, drop "Embedded SQL". The suggested programs are in C.

Chapter 10

Page 666, line 4 after Figure 10.12, drop "as in".

Page 681, 4 lines from the bottom of the page:

ROLLBACK -> ROLL FORWARD

Appendix A

Page 723, in 2 places (lines 9 and 12) replace "sqlload" by "sqlldr" for Oracle 8.0 and later.

Appendix B.3, page 739, last line of Figure B.3:
"%s\n" -> "%.*s\n"

Solutions to Selected Exercises

Page 785, missing solution to [3.1](u):

select distinct cid from orders o where not exists

(select x.cid from orders x, orders y

where x.aid <> y.aid and

x.cid = o.cid and y.cid = o.cid);

Page 786, solution to [3.7](c): Drop the first paragraph.

Page 791, solution to [3.19](b), 4 lines from bottom of page, add column alias "ct":

sum(h1.ct) from -> sum(h1.ct) ct from

Page 792, top line (also in [3.19](b), add missing clause:

from -> from (select h2.dollars, sum(ct1) ct1 from

Page 792, solution to [4.1](c):

people p, people p1 -> people p1, people p2

Page 793, solution to [4.5](a):

where e.fname in -> where e.eperson.pname.fname in

Page 794, solution to [4.7], line 4:

from rectangles r1 -> from rects r1

Page 795, solution to [5.2], drop ".arr" in 2 places:

cust_id.arr, 4, product_id.arr,3 -> cust_id, 4, product_id, 3

Page 806, solution to [7.3], line 1:

is N-1, -> is N-1, with orders on the many side,
Line 3: drop "and has_item":
Line 4, drop ", lineno":

ordno, cid, aid, lineno) -> (ordno, cid, aid)
Lines 8-9: delete "lineno integer not null references line_items"

Page 810, solution to problem [9.1], line 2:
(8 times .0005) = .016 -> (32 times .0005) = .028 seconds.

Index

Page 858: Add:
 RID lists
   and list prefetch, 574
   rules for use, 575
   size limit, 576
 RID pool, 574

Last modified January 22, 2001