About the Reviewer
Emeka is an Electrical Engineer(M.Sc) with strong interest in programming languages. He is certified in Java (programmer) and he is involved in PHP, MySQL and Web client scripts.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

MySQL Cookbook

Author(s) Paul DuBois
Publisher O'Reilly Media
PubDate November, 2006 Second Edition
Reviewer Emeka



One Minute Review


Positives
  • All-encompassing MySQL guide.
  • Cover major scripting languages.
  • Written in a format that is problem-solving oriented that is recipes.
  • Practical problems were used.
  • Could serve as a reference.
Negatives
  • Niggled over details.
  • A scholarly tome.
  • May be confusing to follow(cumbersome)
  • Voluminous


Sections

Intent & Audience

MySQL Cookbook tries to present all the major concepts of MySQL database in a way that could be easily understood and at the same time real-world oriented. This is an attempt to present solutions to most of the real-world problems a database developer/web-based programmer might face in the course of his work with MySQL.  This is indeed a great book, written for all - beginner and professional.
An experienced person would use it as a reference book and a tome. It has a lot of recipes that would be useful for an experienced person while working with MySQL server. Its recipes might serve as templates upon which one could build his applications. This book would help an experienced database developer  to update his knowledge , becuase it covers  MySQL 5 and above.  For a beginner, it has recipes that would get him started and help him progress in MySQL.
The wonderful thing about this book is that it covers virtually all the leading scripting languages (Ruby, PHP, Perl, Python and Java), therefore making it a must read for anyone who uses MySQL for web-based programming.

Relevance of material

Its reach and depth in MySQL database could only be matched by reference books. It is written with the MySQL developer and web-based programmer at heart. It uses hands-on examples' approach, that is recipes, which makes this book to be exciting and fascinating. The author attempts to present to the reader solutions to real-world problems facing web-based programmers and he does this in a style that is thoroughly explained. This great book is not limited to MySQL database; it has a lot of materials on script languages. Note that all the tables,files, scripts and other materials used in this book are available at http://www.kitebird.com/mysql-cookbook/

Chapter highlights

Chapter 1 Using The My Client Program

For a beginner, his first needs are to start and stop MySQL server and how to create user account. This chapter meets those needs. He will also learn how to create Database and Tables and Issuing basic SQL statements, reading other program (SQL file) into MySQL server and sending query output to file. This chapter also explains how to use optional files. In the closing pages of this chapter, the author explains how to use MySQL in shell (UNIX and WINDOWS).

Chapter 2 Writing MySQL-based Program

The author attempts to teach the reader how to connect to MySQL server, Issue statements and Retrieve results using MySQL API languages (Python, Ruby, Java, PHP and Perl). The reader also learns how to write library files. Handling of NULL value in Statement and Result using script language was covered. I must add that the writer assumes that the reader has a working knowledge of at least one of the script languages used. By trying to accommodate all the leading script languages the writer suffers from prolixity which I guess  this makes  chapter 2 a little boring.

Chapter 3  Selecting Data from Table

This chapter is meant to properly expose the reader to SQL language. It teaches you how to use Select statement. You would learn how to use WHERE, AND, ALIASE, CONCAT () and DISTINCT (). In order to avoid making life difficult for the reader, the author also demonstrates how to handle NULL value. You will also learn how to sort and filter result set using ORDER BY, JOIN and LIMIT.

Chapter 4 Table Management

This chapter tries to teach you how to manage tables. It starts with a recipe on cloning of a table to the creation of temporary tables. While working you might decide to check or change a table's storage engine. There is a recipe for that here.

Chapter 5 Working with Strings

In order to design a table properly, you would need to be well grounded in Data type. This chapter attempts to teach you String data type and how to format string using UPPER (), LOWER (), SUBSTRING (), MID () and CONCAT ().You would be able to check or change collation and character set. The reader learns through recipes how to do Pattern Matching using SQL patterns and Pattern Matching using Regular Expression. Finally, this chapter would expose you to FULLTEXT searching using MATCH () and AGAINST ().

Chapter 6 Working with Dates and Time

This chapter could easily be used as a broad reference on Date and Time, however emphasis was on MySQL 5.This chapter describes (using recipes) various ways of using DATE_FORMAT () and TIME_FORMAT () and other functions of Time and Date. The author illustrates how to implement Leap Year calculation using all the leading MySQL API languages (Perl, PHP, Ruby, Python and Java).

Chapter 7 Sorting Query Results

You may be saying that sorting has been covered in chapter 3.Yea, you are right, however here the author tries to deepen your understanding of sorting through recipes that are quite exciting and stimulating. This chapter also teaches FIELD ().

Chapter 8 Generating Summaries

Here, you would learn some Mathematical functions such as COUNT (), MIN (), MAX (), SUM (), and AVG (). This chapter also teaches GROUP BY and HAVING.

Chapter 9 Obtaining and Using Metadata

This chapter's recipes are all based on using script language to retrieve data from the database. By the time you are through with this chapter, you should be able to obtain result set Metadata, Server Metadata, format query output and check the existence of databases or tables. I have to state it again that this book assumed that you have a working knowledge of at least one of the MySQL API used.

Chapter 10 Importing and Exporting Data

Chapter 10 is indeed the longest chapter, and to my mind one of the most useful chapters, it is all about import and export of data. Firstly, it started by using SQL's LOAD DATA to store files into MySQL database and using SQL's INTO OUTFILE to export the result of a query from MySQL into a file. The author implemented (recipes) importing and exporting of data using API languages and it also covers various ways of using patterns matching in data validation. Finally, the author exposed the reader on how to export and import data between MySQL and other applications like Microsoft Access, Excel and XML.

Chapter 11 Generating and Using Sequences

The reader would learn the importance of having AUTO_INCREMENT in his table and various ways it could be implemented. This chapter also teaches how to retrieve Sequence values, Renumbering and exiting Sequence.

Chapter 12 Using Multiple Tables

This chapter would not teach you normalization, however you would learn how to retrieve data from multiple tables. This chapter will introduce you to INNER JOIN, UNION,ON, LEFT and RIGHT JOIN through recipes. There are a lot of fascinating and challenging recipes in this chapter.

Chapter 13 Statistical Techniques

This chapter is not really as scaring as you think. All you have to do is to play with statistical functions. For measure of variation (such as standard deviation and variance) you need STDDEV_SAMP () and VAR_SAMP (). If your concerning is on finding mode and median, I am sorry there are no MySQL in-built functions. You have to compute them yourself.

Chapter 14 Handling Duplicates

Here you are presented with ways of handling duplicates using INSERT IGNORE, DUPLICATE KEY and REPLACE. This chapter also demonstrates ways of removing duplicates using SELECT DISTINCT and conditional IF () statement.

Chapter 15 Performing Transactions

First you would need a storage engine that has the capacity to execute Transaction. This chapter has a recipe that would help you to determine that. The author uses recipes to illustrate how to issue START TRANSACTION statement, ROLLBACK, autocommit and COMMIT. This chapter also teaches you how to perform Transactions in MySQL API Languages (Perl, PHP, Java, Python and Ruby), with each script language having its own recipe. To me this is a repetition and makes this chapter to be boring.

Chapter 16 Using Stored Routines, Triggers, and Events

You need at least MySQL 5.0 before you can run Stored Procedure (for event you need MySQL 5.1). A Stored Procedure is a set of SQL commands that can be compiled and stored in server. In this chapter, you will learn Store Routines, Triggers and Events through recipes.

Chapters 17, 18, 19 and 20 are on database (MySQL) driven web pages (dynamic web sites). Chapter 17 and 18 are on getting MySQL database, Web Server and Script languages up and running, and displaying query results on a web page. Chapter 19 is on retrieving data from web page forms and storing it on MySQL database. Chapter 20 x-rays Session management.

Rating

Relevance  
Readability
Overall

This book will be relevant to anyone who is engaged with MySQL  server. For an experienced person, this book could also be used to update one's knowledge on the newest vervions of MySQL server. For a beginner, this book might be a little difficult to master. On relevance, I would rate this book four. On readability, I rate this book four. It is easy to read and understand, however it niggled over details and that leads to it being voluminous. My overall rating is four, sincerely speaking this book is a must read for web programmers and database developers.

Purchase MySQL Cookbook on Amazon and help Javalobby.