Chapter 2. Writing a Module, Page 23

Location on the page: 
Top of page
Chapter: 
2. Writing a Module
Error: 

CREATE TABLE annotate (
uid int(10) NOT NULL,
nid int(10) NOT NULL,
note longtext NOT NULL,
when int(11) NOT NULL default '0',
PRIMARY KEY (uid, nid),
);

Correction: 

CREATE TABLE annotations (
uid int(11) NOT NULL,
nid int(11) NOT NULL,
note longtext NOT NULL,
created int(11) NOT NULL default 0,
PRIMARY KEY (uid, nid)
)

Description of the Error: 

I know that the SQL is "something like" - but - having pasted it in and used schema module to cut'n'paste the code it would be better if it actually was valid SQL and matched the schema that was used.

There are two points that don't match

1) table name ("annotate" vs. "annotations")
2) column "when" is really column "created" (and "when" is a MySQL reserved word so would need quoting)

Plus - one error (at least for MySQL) - an extra comma after the PRIMARY KEY column.