Press Room

Press Release: January 4, 2006

SQL Cookbook: Getting More from SQL with Expert Techniques and Features

Sebastopol, CA--SQL is one of the topics that many programmers learn a little about, but just enough to eke by while building that web application or performing a task in the office. It's a deceptively easy language to learn. Database developers can begin with the simple statement: SELECT FROM

WHERE and accomplish quite a bit. Many, in fact, don't go far beyond that. Yet, there is so much more that the language can do. In SQL Cookbook (O'Reilly, US $ 39.95), experienced SQL developer Anthony Molinaro shows off his favorite SQL techniques and features.

Molinaro has provided an exceptional resource for all SQL programmers interested in getting the best out of the language. Molinaro says, "Databases are the foundation of IT So, knowing how to retrieve information is of utmost importance. Additionally, poorly performing SQL is typically at the root of database performance problems; knowing how to write efficient queries enables fast data access, which is crucial today. People want their information and they want it immediately. Knowing new features such as window functions provides better performance in many cases. Moreover, window functions allow you to do in SQL what used to be done in application code."

The book contains more than 200 recipes for solving SQL problems. Molinaro describes it, "Queries, queries, queries. My goal from the beginning was not so much to write a 'SQL Cookbook' as to write a 'Query Cookbook.' I've aimed to create a book of queries ranging from the relatively easy to the difficult in hopes the reader would grasp the techniques behind those queries and use them to solve their own business problems."

SQL Cookbook covers SQL Server, PostgreSQL, Oracle, MySQL, and DB2, and includes recipes on the following important topics:

  • Window functions
  • Pivoting rows into columns
  • Reverse-pivoting columns into rows
  • Creating histograms
  • Summarizing data into buckets
  • Generating running totals and subtotals
  • Walking a string
  • Vendor specific features such as Server's PIVOT, Oracle's MODEL clause, and PostgreSQL's GENERATE_SERIES
  • Molinaro is known as the go-to guy among his clients when it comes to difficult SQL query problems. He's thoroughly well versed in the subject, understands relational theory, and has nine years hands-on experience solving tough SQL problems. He has given SQL users at all levels the ideal book, written in the popular problem/solution/discussion format of O'Reilly's Cookbook series.

    If you know the rudiments of the SQL query language, yet aren't taking full advantage of it, the SQL Cookbook can show you how to get more out SQL before you resort to other tools or languages.

    As Olivier Pomel, director of technology for Wireless Generation, Inc. says, "Once you find out how many lines of convoluted application code you can save when leveraging SQL, this book won't leave your desk."

    Additional Resources:

    SQL Cookbook
    Anthony Molinaro
    ISBN: 0-596-00976-3, 595 pages, $39.95 US
    1-800-998-9938; 1-707-827-7000

    About O'Reilly

    For almost 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through the company’s Safari training and learning platform and at O’Reilly conferences. As a SaaS learning platform, Safari delivers highly topical and comprehensive technology and business learning solutions to millions of users across enterprise, consumer, and university channels. For more information visit

    Return to: O'Reilly Press Room

    Recent Press Releases

    12/12/17 O'Reilly Media named a Top 20 IT Training Company by Training Industry
    11/1/17 Safari: O'Reilly's Learning Platform for Higher Education now available from ProQuest
    9/18/17 O'Reilly Media Announces Expansion of Leadership Team
    8/28/17 New from O'Reilly Media: Live online courses add hands-on coding "Powered by Jupyter"
    8/9/17 O'Reilly Velocity Conference comes to New York, October 1–4, 2017

    Press Release Archive »


    Press Contacts


    Sara Winge
    1-800-998-9938 x7109

    Media Relations – North America & Conferences

    Maureen Jennings
    1-800-998-9938 x7083

    Media Relations – Japan

    Fumi Yamakawa
    +81 3-3356-5227

    Media Relations – United Kingdom

    Helen Coding
    +44 (0) 1252 721284