SQL Cookbook: Query Solutions and Techniques for Database Developers

Front Cover
"O'Reilly Media, Inc.", Dec 16, 2005 - Computers - 636 pages
8 Reviews
Reviews aren't verified, but Google checks for and removes fake content when it's identified

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.


What people are saying - Write a review

User ratings

5 stars
4 stars
3 stars
2 stars
1 star

Reviews aren't verified, but Google checks for and removes fake content when it's identified

SQL cookbook

User Review  - Not Available - Book Verdict

SQL is the standard programming language for creating, manipulating, and retrieving information stored in relational databases; most libraries should own one or more guides.SQL Cookbook , a ... Read full review

User Review - Flag as inappropriate

Hi there... This book is really gr8 and u will find it helpful in day to day job functions as a developer...But I am not able to find code download link for examples used in this book.If some one knows about code example download link then pls pls email me at gurjeetsaini@gmail.com....cheers


Retrieving Records
Sorting Query Results
Working with Multiple Tables
Inserting Updating Deleting
Metadata Queries
Working with Strings
Working with Numbers
Date Arithmetic
Working with Ranges
Advanced Searching
Reporting and Warehousing
Hierarchical Queries
Odds n Ends
Window Function Refresher
Rozenshtein Revisited

Date Manipulation

Other editions - View all

Common terms and phrases

Popular passages

Page 4 - or comm is not null or sal <= 2000 ) and deptno=20 EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7369 SMITH CLERK 7902

About the author (2005)

Anthony Molinaro is a SQL developer and database administrator with many years experience in helping developers improve their SQL queries. SQL is particular passion of Anthony's, and he's become known as the go-to guy among his clients when it comes to solving difficult SQL query problems. He's well-read, understands relational theory well, and has nine years of hands-on experience solving tough, SQL problems. Anthony is particularly well-acquainted with new and powerful SQL features such as the windowing function syntax that was added to the most recent SQL standard.

Bibliographic information