MySQL Errata Sheet

Version 1.00, 2000-03-20



Overview

This document lists the known errors for the book:

MySQL
Paul DuBois
New Riders Publishers
1999

The document is maintained by Paul DuBois, paul@snake.net. Please report to that address any errors you find in the book that are not already listed here.

The current version of this document is available at the MySQL Web site, in the Examples area.


The output from some of the example queries in Chapter 1 differs from what you will see if you run the queries yourself. This is because I changed some of the sample data, but forgot to change a few of the examples in the book. There are also a couple of instances where you may see different output, depending on your version of MySQL. The corrected output for such examples is shown below.


Page 43, query 1.

The version number shown in the final column will depend on the version of MySQL that you are running.


Page 43, query 2.

The output should look like this:


+-----------+-----+------------+
| name      | sex | student_id |
+-----------+-----+------------+
| Megan     | F   |          1 |
| Joseph    | M   |          2 |
| Kyle      | M   |          3 |
| Katie     | F   |          4 |
...

Page 43, query 3.

The output should look like this:


+-----------+
| name      |
+-----------+
| Megan     |
| Joseph    |
| Kyle      |
| Katie     |
...

Page 43, query 4.

The output should look like this:


+-----------+-----+------------+
| name      | sex | student_id |
+-----------+-----+------------+
| Megan     | F   |          1 |
| Joseph    | M   |          2 |
| Kyle      | M   |          3 |
| Katie     | F   |          4 |
...

Page 44, query 1.

The output should look like this:


+------------+----------+-------+
| student_id | event_id | score |
+------------+----------+-------+
|          5 |        3 |    97 |
|         18 |        3 |    96 |
|          1 |        6 |   100 |
|          5 |        6 |    97 |
|         11 |        6 |    98 |
|         16 |        6 |    98 |
+------------+----------+-------+

Page 50, query 3.

The output will vary depending on the value returned by the RAND() function.


Page 56, query 1.

The output is missing from the book. It should look like this:


+-----------+------------+
| last_name | first_name |
+-----------+------------+
| Polk      | James K.   |
| Taft      | William H. |
| Ford      | Gerald R   |
| Bush      | George W.  |
+-----------+------------+

Page 58, query 3.

The rows of the output are reversed. They should look like this:


+-----+----------+
| sex | COUNT(*) |
+-----+----------+
| F   |       15 |
| M   |       16 |
+-----+----------+

Page 65, query 1.

The query produces no more lines of output than are shown. The "..." is incorrect.


Page 42. middle of page.
Reported on: 2000-02-08
Reported by: Derick Siddoway

Change the query that says:


SELECT birth_date FROM ...

To:


SELECT birth FROM ...

Page 338, paragraph following second bullet.
Reported on: 2000-02-09
Reported by: Derick Siddoway

Change:

The tables in the samp_db table are relatively ...

To:

The tables in the samp_db database are relatively ...

And change:

If you edit samp_db to display tables from ...

To:

If you edit samp_browse to display tables from ...


Page 372, listing for add_new_event() function.
Reported on: 2000-02-12
Reported by: Marc Infield

There is an instance of addslashes() written incorrectly as $addslashes().

Change:


addslashes ($date), $addslashes ($type));

To:


addslashes ($date), addslashes ($type));

Page 527, description of the SIN() function.
Reported on: 2000-02-15
Reported by: David Block

There should not be two bullets for the SIN() function. The text of the second SIN() bullet is part of the preceding description.


Page 125, second paragraph after first code listing.
Reported on: 2000-03-01
Reported by: Ryan Caveney

Change:

For example, (4*3)/(4-2) evaluates to the value 2.

To:

For example, (4*3)/(4-2) evaluates to the value 6.


Page 56, last code listing, page 58, last code listing, page 59 last code listing.
Reported on: 2000-03-20
Reported by: John P. McDaniel

The state abbreviation for Arkansas is AR, not AK. Change the AK in the three listings to AR.