Why do you have two keys in the categories declaration on page 51 for your categories table? And also what is the difference between a primary and unique key?
CREATE TABLE categories(
id SMALLINT NOT NULL AUTO INCREMENT,
category VARCHAR(30) NOT NULL,
PRIMARY KEY ('id'),
UNIQUE KEY 'category' ('category')
)