small medium large xlarge

Errata for SQL Antipatterns

 

The latest version of the book is P4.0, released over 2 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P4.0 (26-Oct-16)
#80838
PDF page: 2
The author refers to Lisp and Haskell as "declarative languages". That isn't actually true. In some situations, they can be more declarative than (s...more...
  • Reported in: P3.0 (28-Aug-12)
#49748
PDF page: 15
By default, MySQL does not allow '||' as string concatenation operator but works like 'Logical OR' operator. So MySQL users should use CONCAT function...more...
  • Reported in: P4.0 (29-Nov-15)
#79246
Paper page: 20

Jaywalking/soln/group.sql uses c.contacts_per_product in the outer query, but the inner query names accounts_per_product.--Magne Land

  • Reported in: P3.0 (28-Aug-12)
#49745
PDF page: 27
Column 'author' is FK with NOT NULL referencing Account table. Column 'comment_date' is NOT NULL. Reply author may not be 'Kukla' but 'Ollie'? In...more...
  • Reported in: P3.0 (28-Aug-12)
#49746
PDF page: 32
Ditto with p.27. Column 'author' is FK with NOT NULL referencing Account table. Column 'comment_date' is NOT NULL. In code file Trees/soln/path-e...more...
  • Reported in: P3.0 (28-Aug-12)
#49749
PDF page: 32
MySQL causes ERROR 1093 (HY000) on UPDATE when running Trees/soln/path-enum/insert.sql. ========== mysql> UPDATE Comments -> SET path = (SEL...more...
  • Reported in: P3.0 (28-Aug-12)
#49750
PDF page: 33
TYPO in table name. Should be 'Comments'. TYPOs are in p.33: Trees/soln/nested-sets/ancestors.sql p.34: Trees/soln/nested-sets/depth.sql p.35: ...more...
  • Reported in: P3.0 (28-Aug-12)
#49755
PDF page: 34
First query reports depth = 4 and second query reports depth = 3 TYPO in table name. Should be 'Comments' (as I reported in #49750). In code file ...more...
  • Reported in: P4.0 (09-Jun-16)
#80414
Paper page: 35
Tree/soln/nested-sets/insert.sql shows a UPDATE statement to insert a new leaf node below comment #5 which results in NS values 8 and 9 being spaced i...more...
  • Reported in: P3.0 (28-Aug-12)
#49747
PDF page: 35
Column 'author' is FK with NOT NULL referencing Accounts table. Column 'bug_id' is FK with NOT NULL referencing Bugs table. Column 'comment_date' is...more...
  • Reported in: P3.0 (28-Aug-12)
#49756
PDF page: 35
For immediate parent search, parent.sql in p.35 returns empty set. Should use > and < instead of BETWEEN since > and < are exclusive. TYPO in table ...more...
  • Reported in: P3.0 (28-Aug-12)
#49752
PDF page: 106
Missing comma after "resolution VARCHAR(1000)". In code file Metadata-Tribbles/soln/separate-fixed-length.sql: ========== CREATE TABLE BugDescr...more...
  • Reported in: P3.0 (28-Aug-12)
#49753
PDF page: 128
Missing comma after "account_id SERIAL PRIMARY KEY". In code file Phantom-Files/anti/create-accounts.sql: ========== CREATE TABLE Accounts ( ...more...
  • Reported in: P4.0 (06-Jul-16)
#80502
PDF page: 193
The sentence “Each of the twelve rows for FIXED bugs is paired with all seven rows for OPEN bugs.” in the chapter “Antipattern: Solve a Complex ...more...
  • Reported in: P3.0 (28-Aug-12)
#49754
PDF page: 246
Wrong variable name '$dbh' In code file See-No-Evil/anti/no-check.php: ========== ... ② $stmt = $dbh->prepare($sql); ... ========== may b...more...
  • Reported in: P3.0 (16-Aug-12)
#49707
PDF page: 413
Appendix 1.1; Figure 26 (Third Normal Form). Table Accounts has tuple {Moe, moe@example.com} repeated. A typo, but technically violates PK {account_id...more...

Stuff To Be Considered in the Next Edition

  • Reported in: P2.0 (10-Jan-12)
#48485
PDF page: 168
The book recommends to use separate queries for achieving the goal ("Follow the Single-Value Rule to avoid ambiguous query result"). Suggestion: Pl...more...
Bill Karwin says: Using windowing functions is a valid solution, thanks for the suggestion. But unfortunately space restrictions prevent me from adding another solution to the chapter.