BUY THIS BOOK
Add to Cart

Print Book $39.95


Add to Cart

PDF $31.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £28.50

What is this?

Looking to Reprint or License this content?

SQL Cookbook

By Anthony Molinaro
First Edition  December 2005 
Pages: 628
Series: Cookbooks
ISBN 10: 0-596-00976-3 | ISBN 13: 9780596009762
starstarstarstarstar (Average of 4 Customer Reviews)

Buy 2 Get 1 Free Free ShippingGuarantee

Book description

This convenient guide is for anyone who wants to take his or her SQL skills to the next level. Packed with over 200 recipes, the SQL Cookbook helps you conquer common data query and manipulation problems, including those related to window functions, data warehousing, and string manipulation. Features an easy-to-grasp problem-solution-discussion format.
Full Description

You know the rudiments of the SQL query language, yet you feel you aren't taking full advantage of SQL's expressive power. You'd like to learn how to do more work with SQL inside the database before pushing data across the network to your applications. You'd like to take your SQL skills to the next level.

Let's face it, SQL is a deceptively simple language to learn, and many database developers never go far beyond the simple statement: SELECT <columns> FROM <table> WHERE <conditions>. But there is so much more you can do with the language. In the SQL Cookbook, experienced SQL developer Anthony Molinaro shares his favorite SQL techniques and features. You'll learn about:

  • Window functions, arguably the most significant enhancement to SQL in the past decade. If you're not using these, you're missing out
  • Powerful, database-specific features such as SQL Server's PIVOT and UNPIVOT operators, Oracle's MODEL clause, and PostgreSQL's very useful GENERATE_SERIES function
  • Pivoting rows into columns, reverse-pivoting columns into rows, using pivoting to facilitate inter-row calculations, and double-pivoting a result set
  • Bucketization, and why you should never use that term in Brooklyn.
  • How to create histograms, summarize data into buckets, perform aggregations over a moving range of values, generate running-totals and subtotals, and other advanced, data warehousing techniques
  • The technique of walking a string, which allows you to use SQL to parse through the characters, words, or delimited elements of a string

Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.

Browse within this book

Cover | Table of Contents




Featured customer reviews

Write a Review


Not able to find code donload link!,  November 16 2007
Submitted by Anonymous Reader   [Respond | View]

Hi,
The editor of the book sent me a note shortly after the book was released about the lack of downloadable example code, saying:
The SQL Cookbook author and I made a conscious decision not to offer downloadable code. We did that for a couple of reasons. Solution snippets tend to be small. And the nature of SQL is such that queries need to be crafted to match the database design. Rarely, if ever, will any reader be able to directly drop our SQL into their application. What's important is that they grasp the technique of a given recipe, and then adapt that technique to their own situation.


Not able to find code donload link!,  November 15 2007
Rating: StarStarStarStarStar
Submitted by Gurjeet   [Respond | View]

Hi there.
The sql cook book book is really gr8...But some one pls tell me that where is the link to the code used in this book as this book doesnt have any cd an also there is no online link for code download...any help would me much appreciated!


I'm listening...,  July 13 2006
Submitted by Anonymous Reader   [Respond | View]

Thanks for the nice review.
I want to address this comment you made:

"The only reason I gave it a four-star rating is that it doesn't have all the answers I need. If it did, it would have been a goldmine!"

You can email me anytime at amolinaro@wgen.net with questions, comments, and even requests for the next edition. if you have recipe or problem that you wish i would have included, contact me and i'll do my best to solve your problem and if it works for you will include it in the next edition.

take care,
ant

Read all reviews


Excellent desktop resource book!,  July 03 2006
Rating: StarStarStarStarStar
Submitted by Roanoke Valley SQL Server Users Group   [Respond | View]

This book review was submitted by a Roanoke Valley SQL Server Users Group member as part of the Book Review Program.

Reviewed by Harold Buckner

This is a great book to have available at your fingertips. The table of contents is structured quite nicely and allows you to find what you need very quickly. The book covers a number of topics for solving everyday problems. It will also help you come up with ideas on how to go about handling particular queries by describing the problems and then listing possible solutions. And in these solutions you can find techniques on how to expand on them to resolve other issues.

The author Anthony Molinaro, included a chapter on Metadata Queries that would be great for the beginner DBA wanting to find information about the database schema as well as other chapters on String manipulation, working with numbers, dates, warehousing and hierarchical queries. The author includes solutions for various platforms that I thought were nice to see how the different platforms handled the solutions. I also thought the author did a great job expanding the solution to help you understand what was happening.

Great job Anthony and I hope to see more structured like this one.

Harold Buckner


A MUST HAVE book for anyone who works with real-world databases,  June 12 2006
Rating: StarStarStarStarStar
Submitted by vCurios   [Respond | View]

Discovering Anthony Molinaro's excellent book was pure serendipity and a wonderful one at that. For a while now I have been cobbling together notes on how to programmatically access some 300 servers variously hosting Microsoft SQL Server, MySQL, and Oracle. The cookbook covers these three (as well as IBM DB2 and PostgresSQL).

I am 100% sure Mr. Molinaro's SQL Cookbook will save me dozens of hours of navigating through (a) the obtuse documentation of the three vendors and trying to sort out their respective dialects, and (b) the many well-meaning but poorly written SQL help sites that come up in Google. Indeed, as far as I am concerned, the book has already more than paid for itself in the time saved. A key strength of this cookbook (in addition to being very well written, edited, and produced) is it is very logically organized and makes it quite easy to find the topic you want.

The only reason I gave it a four-star rating is that it doesn't have all the answers I need. If it did, it would have been a goldmine! But, seriously, if you are "SQL-challenged" like some of us (i.e., not an SQL guru), and you think your time is worth more than $40 an hour, you should get this book, even if you are working with just one of the three SQL platforms. If you are working with two or more versions, get this book, regardless!

I'd like to take this opportunity to thank Mr. Molinaro for doing a great job helping me devote the time saved to other equally challenging adventures, like golf!


Great stuff!,  March 18 2006
Rating: StarStarStarStarStar
Submitted by Dima   [Respond | View]

Simply great stuff you won't find anywhere else!


Media reviews
"In this most excellent cookbook, you will find a collection of common SQL problems and their solutions that you'll find helpful in your day-to-day work. More importantly, this cookbook will help you take your SQL skills to the next level. "
-- John Vacca, "Tech Write Independent Reviewer", Amazon.com


"This is an excellent book; it does exactly what it sets out to do and fully equips you to handle the most sophisticated database transactions."
-- Simon P. Chappell, Slashdot.org


"It is an excellent book for anyone who wants to learn SQL and takes advantage of the power of SQL. If you are developing software or application to support multiple database platform, this is a must have reference. If you are familiar with one databse platform, such as Oracle, and now you are working on different database platform, such as MySql, it will help you to grasp it in no time."
-- New Lethbridge .NET User Group, Amazon.com



Read all reviews

See larger cover


"...this cookbook will help you take your SQL skills to the next level."
--John Vacca, "Tech Write Independent Reviewer", Amazon.com