Minecraft Adventures B2G1 Free

Special Offers see all

Enter to WIN a $100 Credit

Subscribe to PowellsBooks.news
for a chance to win.
Privacy Policy

Visit our stores

    Recently Viewed clear list

    Interviews | August 31, 2015

    Shawn Donley: IMG Bill Clegg: The Powells.com Interview

    Bill CleggIn January of this year, eight months before its release date, the buzz was already starting to build for Bill Clegg's Did You Ever Have a Family.... Continue »
    1. $18.20 Sale Hardcover add to wish list

      Did You Ever Have a Family

      Bill Clegg 9781476798172

Qualifying orders ship free.
Used Trade Paper
Ships in 1 to 3 days
Add to Wishlist
Qty Store Section
1 Hawthorne COMP- DATA SQL

MySQL Cookbook


MySQL Cookbook Cover

ISBN13: 9780596527082
ISBN10: 059652708x
Condition: Standard
All Product Details

Only 1 left in stock at $30.00!


Out of Print

Synopses & Reviews

Publisher Comments:

Along with MySQL's popularity has come a flood of questions about solving specific problems, and that's where this Cookbook is essential. Designed as a handy resource when you need quick solutions or techniques, the book offers dozens of short, focused pieces of code and hundreds of worked-out examples for programmers of all levels who don't have the time (or expertise) to solve MySQL problems from scratch.

The new edition covers MySQL 5.0 and its powerful new features, as well as the older but still widespread MySQL 4.1. One major emphasis of this book is how to use SQL to formulate queries for particular kinds of questions, using the mysql client program included in MySQL distributions. The other major emphasis is how to write programs that interact with the MySQL server through an API. You'll find plenty of examples using several language APIs in multiple scenarios and situations, including the use of Ruby to retrieve and format data. There are also many new examples for using Perl, PHP, Python, and Java as well.

Other recipes in the book teach you to:

  • Access data from multiple tables at the same time
  • Use SQL to select, sort, and summarize rows
  • Find matches or mismatches between rows in two tables
  • Determine intervals between dates or times, including age calculations
  • Store images into MySQL and retrieve them for display in web pages
  • Get LOAD DATA to read your data files properly or find which values in the file are invalid
  • Use strict mode to prevent entry of bad data into your database
  • Copy a table or a database to another server
  • Generate sequence numbers to use as unique row identifiers
  • Create database events that execute according to a schedule
  • And a lot more

MySQL Cookbook doesn't attempt to develop full-fledged, complex applications. Instead, it's intended to assist you in developing applications yourself by helping you get past problems that have you stumped.

Book News Annotation:

This collection of 281 recipes shows how to write a query, apply a technique, or develop a script to solve a problem of limited scope using the Perl, PHP, Python, and Java APIs in the MySQL 5.0 database management system. Topics include the MySQL command line client, record selection techniques, working with dates and times, modifying the structure of tables, transferring data between MySQL and other programs, generating sequences, statistical techniques, and processing web input. Annotation ©2008 Book News, Inc., Portland, OR (booknews.com)


DuBois provides a unique problem-and-solution format that offers practical examples for everyday programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe"--short, focused pieces of code that readers can insert directly into their applications.


DuBois provides a unique problem-and-solution format that offers practical examples for everyday programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe"--short, focused pieces of code that readers can insert directly into their applications.

About the Author

Paul DuBois is a recognized expert on MySQL and leader in the open source community. He is now on the staff of MySQL AB and is in charge of the company's English-language documentation. He is a regular speaker at open source conferences such as the O'Reilly Open Source convention, and is co-author of the MySQL Certification Study Guide.

Table of Contents

Preface Who This Book Is For What's in This Book MySQL APIs Used in This Book Conventions Used in This Book The MySQL Cookbook Companion Web Site Version and Platform Notes Upgrade Note for First Edition Readers Additional Resources Using Code Examples Safari® Enabled How to Contact Us Acknowledgments Chapter 1: Using the mysql Client Program Introduction Setting Up a MySQL User Account Creating a Database and a Sample Table Starting and Stopping mysql Specifying Connection Parameters Using Option Files Protecting Option Files from Other Users Mixing Command-Line and Option File Parameters What to Do if mysql Cannot Be Found Issuing SQL Statements Canceling a Partially Entered Statement Repeating and Editing SQL Statements Using Auto-Completion for Database and Table Names Telling mysql to Read Statements from a File Telling mysql to Read Statements from Other Programs Entering an SQL One-Liner Using Copy and Paste as a mysql Input Source Preventing Query Output from Scrolling off the Screen Sending Query Output to a File or to a Program Selecting Tabular or Tab-Delimited Query Output Format Specifying Arbitrary Output Column Delimiters Producing HTML or XML Output Suppressing Column Headings in Query Output Making Long Output Lines More Readable Controlling mysql's Verbosity Level Logging Interactive mysql Sessions Creating mysql Scripts from Previously Executed Statements Using User-Defined Variables in SQL Statements Numbering Query Output Lines Using mysql as a Calculator Using mysql in Shell Scripts Problem Solution Discussion Chapter 2: Writing MySQL-Based Programs Introduction Connecting, Selecting a Database, and Disconnecting Problem Solution Discussion Checking for Errors Problem Solution Discussion Writing Library Files Problem Solution Discussion Issuing Statements and Retrieving Results Problem Solution Discussion Handling Special Characters and NULL Values in Statements Problem Solution Discussion Handling Special Characters in Identifiers Identifying NULL Values in Result Sets Problem Solution Discussion Techniques for Obtaining Connection Parameters Problem Solution Discussion Conclusion and Words of Advice Chapter 3: Selecting Data from Tables Introduction Specifying Which Columns to Select Specifying Which Rows to Select Giving Better Names to Query Result Columns Using Column Aliases to Make Programs Easier to Write Combining Columns to Construct Composite Values WHERE Clauses and Column Aliases Debugging Comparison Expressions Removing Duplicate Rows Working with NULL Values Writing Comparisons Involving NULL in Programs Sorting a Result Set Using Views to Simplify Table Access Selecting Data from More Than One Table Selecting Rows from the Beginning or End of a Result Set Selecting Rows from the Middle of a Result Set Choosing Appropriate LIMIT Values What to Do When LIMIT Requires the Wrong Sort Order Calculating LIMIT Values from Expressions Chapter 4: Table Management Introduction Cloning a Table Saving a Query Result in a Table Creating Temporary Tables Checking or Changing a Table's Storage Engine Generating Unique Table Names Chapter 5: Working with Strings Introduction String Properties Choosing a String Data Type Setting the Client Connection Character Set Properly Writing String Literals Checking a String's Character Set or Collation Changing a String's Character Set or Collation Converting the Lettercase of a String Converting the Lettercase of a Stubborn String Controlling Case Sensitivity in String Comparisons Pattern Matching with SQL Patterns Pattern Matching with Regular Expressions Controlling Case Sensitivity in Pattern Matching Breaking Apart or Combining Strings Searching for Substrings Using FULLTEXT Searches Using a FULLTEXT Search with Short Words Requiring or Excluding FULLTEXT Search Words Performing Phrase Searches with a FULLTEXT Index Chapter 6: Working with Dates and Times Introduction Choosing a Temporal Data Type Changing MySQL's Date Format Setting the Client Time Zone Determining the Current Date or Time Using TIMESTAMP to Track Row Modification Times Extracting Parts of Dates or Times Problem Solution Discussion Synthesizing Dates or Times from Component Values Converting Between Temporal Data Types and Basic Units Problem Solution Discussion Calculating the Interval Between Two Dates or Times Problem Solution Discussion Adding Date or Time Values Problem Solution Discussion Calculating Ages Shifting a Date-and-Time Value to a Different Time Zone Finding the First Day, Last Day, or Length of a Month Calculating Dates by Substring Replacement Finding the Day of the Week for a Date Finding Dates for Any Weekday of a Given Week Performing Leap Year Calculations Problem Solution Discussion Canonizing Not-Quite-ISO Date Strings Treating Dates or Times as Numbers Forcing MySQL to Treat Strings as Temporal Values Selecting Rows Based on Their Temporal Characteristics Problem Solution Discussion Chapter 7: Sorting Query Results Introduction Using ORDER BY to Sort Query Results Using Expressions for Sorting Displaying One Set of Values While Sorting by Another Controlling Case Sensitivity of String Sorts Date-Based Sorting Sorting by Calendar Day Sorting by Day of Week Sorting by Time of Day Sorting Using Substrings of Column Values Sorting by Fixed-Length Substrings Sorting by Variable-Length Substrings Sorting Hostnames in Domain Order Sorting Dotted-Quad IP Values in Numeric Order Floating Values to the Head or Tail of the Sort Order Sorting in User-Defined Orders Sorting ENUM Values Chapter 8: Generating Summaries Introduction Summarizing with COUNT

What Our Readers Are Saying

Add a comment for a chance to win!
Average customer rating based on 1 comment:

bubbly, March 12, 2008 (view all comments by bubbly)
Mysql Cook Book very useful for naive users as well as experience data base developers and admins.
It will helpful to memorize the functions and utilities
Was this comment helpful? | Yes | No
(1 of 2 readers found this comment helpful)

Product Details

Dubois, Paul
O'Reilly Media
DuBois, Paul
Programming - General
Programming Languages - SQL
Database management
Relational databases
Database Management - Database Mining
Database Management - Data Warehousing
Computer Languages-SQL
Database Management - General
CourseSmart Subject Description
Edition Number:
Edition Description:
Second Edition
Publication Date:
9.2 x 7 x 2.1 in 2.97 lb

Other books you might like

  1. CSS Cookbook (Cookbooks) Used Trade Paper $25.00
  2. Cairo Illustrated Used Trade Paper $11.00
  3. Learning Perl 4TH Edition Used Trade Paper $21.00
  4. Perl Cookbook Used Trade Paper $14.95

Related Subjects

Computers and Internet » Computer Languages » SQL
Computers and Internet » Database » Applications
Computers and Internet » Database » Design
Computers and Internet » Database » SQL
Computers and Internet » Software Engineering » Software Management

MySQL Cookbook Used Trade Paper
0 stars - 0 reviews
$30.00 In Stock
Product details 980 pages O'Reilly Media - English 9780596527082 Reviews:
"Synopsis" by ,
DuBois provides a unique problem-and-solution format that offers practical examples for everyday programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe"--short, focused pieces of code that readers can insert directly into their applications.
"Synopsis" by ,
DuBois provides a unique problem-and-solution format that offers practical examples for everyday programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe"--short, focused pieces of code that readers can insert directly into their applications.
  • back to top


Powell's City of Books is an independent bookstore in Portland, Oregon, that fills a whole city block with more than a million new, used, and out of print books. Shop those shelves — plus literally millions more books, DVDs, and gifts — here at Powells.com.