I have written several MySQL books, so people sometimes ask, "Which
of your books should I get?
How do they differ?"
Naturally, I think the answer to the first question is
that you should get them all.
There is a certain amount of overlap, of course,
because all of them are about MySQL.
But not as much overlap
as you might think, and each book really is quite different from the others.
With regard to the second question, here's a brief description of
what the books cover:
is what might be described as a general textbook.
It's intended to give you the information you need to become a well-rounded
It's divided into three main sections dealing with the SQL language (how to
write queries), programming interfaces (how to write your own MySQL-based
using C, Perl, and PHP), and MySQL administration (how to keep your
installation running smoothly).
The book also contains a substantial set of reference appendixes that are
helpful when you need to look up those details you can't remember:
Syntax for a SQL statement, how to invoke a SQL function, which options a
MySQL program supports, how to use a C/Perl/PHP function.
This is the book to start off with if you're not already an experienced MySQL
MySQL and Perl for the Web
focuses on writing database-based web applications.
It details how to use the Perl DBI module to interact with MySQL
and the Perl CGI.pm module for generating web pages and for processing information
submitted over the web to your programs.
The emphasis on Perl makes
this more of a narrowly focused book than the other two.
I've heard from people that the book is helpful even if you're
using other languages such as PHP;
although the book uses DBI and
CGI.pm, much of the discussion in the book is framed in terms of principles
that apply to web development in any language.)
If you want to put your database on the web, this book shows you how.
contains zillions of short sections that describe how to solve specific
It's the type of book
you use when you think "Hmm, I need to do XXX, how can I accomplish that?"
The Cookbook shows a lot of SQL-oriented techniques,
and it also discusses writing MySQL programs in Perl, PHP, Python, and Java.
Some of the programs are intended for use in a command-line environment.
Others are web-oriented,
using Apache for Perl/PHP/Python, and Tomcat for Java/JSP/JSTL.
A problem-and-solution book with answers to questions every
MySQL user faces.