SQL Cookbook (Cookbooks (O'Reilly))

  Author:    Anthony Molinaro
  ISBN:    0596009763
  Sales Rank:    12395
  Published:    2005-12-01
  Publisher:    O'Reilly Media, Inc.
  # Pages:    628
  Binding:    Paperback
  Avg. Rating:    5.0 based on 39 reviews
  Used Offers:    12 from $22.37
  Amazon Price:    $26.37
  (Data above last updated:  2008-09-06 06:38:21 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
SQL Cookbook (Cookbooks (O'Reilly))
  

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 FROM

WHERE . 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.

                  Reader Reviews 1 - 33 of 33                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
03-07-08 2 1\8
(Hide Review...)  Good book, but shipped falling apart
Reviewer Permalink
Content is excellent, with good examples. I was able to solve a prloblem the very first time I used it. The issue I have is more with Amazon in that I ordered this book in a shipment of 4 others, so it was over a month before I cracked this one open. To my dismay, the binding is not glued on and the book is falling apart. Amazon customer service has not even responded to my three emails asking for resolution.

(Review Data Last Updated: 2008-09-05 06:44:33 EST)
02-25-08 5 1\1
(Hide Review...)  As a reference
Reviewer Permalink
I found this book to be very complete. Providing solutions for multiple DBMSs was greately appreciated. I have been in I.T. for a long time and I have read many many books on all types of subjects. I often (too often) am disappointed with books I purchase. However, sometimes I am pleasantly surprised... this is one of those time.

I create numerous queries using all types of tools. As such, I sometimes insert the wrong syntax into a query. This book helps to quickly correct the error. In addition, it has given me some "tricks" that I was unaware of that have helped to simplify some of my queries.

It would be very advantageous to have the info in this book on a searchable site or application

Buy it, read it, and keep it close by to reference to.
(Review Data Last Updated: 2008-03-08 03:08:27 EST)
02-25-08 5 1\1
(Hide Review...)  A great book!
Reviewer Permalink
I am a certified DB2 / Oracle DBA and a programmer. Even though, I can get through some of chapters very fast, I certainly have enjoyed reading it so far. One thing I like the most is to see how a problem is solved in many different databases including DB2, Oracle, MS-SQL, MySQL, and PostSQL!
(Review Data Last Updated: 2008-03-08 03:08:27 EST)
08-03-07 5 0\1
(Hide Review...)  It is real cook book
Reviewer Permalink
I am completely satisfied with this book.
Instead of inventing all the time "bicycle" I can use this book in my everyday work and concentrate on more important things in my projects.
(Review Data Last Updated: 2008-02-26 07:51:20 EST)
06-26-07 4 (NA)
(Hide Review...)  MS SQL Server must be 2005
Reviewer Permalink
This is a great product but some of the advanced features weren't available in SQL Server 2000. I really liked the windowing and hierarchical queries in this book but those features are not available in 2000. For the most part 2000 isn't used that often anymore but if you are one of the unfortunate to have to use it there will be some compatibility problems with the examples in this book.
(Review Data Last Updated: 2007-08-03 15:26:06 EST)
05-09-07 5 6\6
(Hide Review...)  Mind-expanding
Reviewer Permalink
It doesn't take long to learn the basics of SQL. Once you start to do multi-table joins and you get to sub-selects and outer joins you can almost convince yourself you are an expert. Trust me. You aren't. I've read at least ten books on using SQL. This is the first one to blow my horizons away and open a completely new landscape.

The "recipies" are well explained and almost entirely practical and useful. This book showed me dozens of things I did not ever think of using SQL for, even though I have the BNF for SQL pretty much in my head after more than 18 years of being a practicing programmer.

Before this book I used to recommend "generic" SQL books to students and newbies because such books apply to virtually all SQL databases and it can be harmful for one to use a specific "dialect" (such as Oracle or SQL Server) that won't port to other SQL databases. I would urge people to learn "generic" SQL. You can always add the features of you specific dialect, but it is hard to give up features you assume will be in all dialects.

This book neatly avoids that problem by providing dialect-specific sections when you can or must code differently for a particular database. Even better, they explain the differences and the pros and cons of those differences. So this book can even be an aid to selecting the "right" database for your application.

I happen to be a fan of Open Source and Free Software and I'm pleased to say that this book covers both MySQL and PostgreSQL. Naturally it provides the "big three" of Oracle, Microsoft SQL Server, and IBM's DB2.

This book really opened my eyes to possibilities in SQL that I really didn't know existed in spite of the fact that I have been using the language (apparently without mastering it) for almost two decades.

I still recommend using a "generic SQL" book to learn the basics, but this should literally be ordered at the same time. It is the best of the "Cookbook" series that I have seen. (And I have used the Java Cookbook, Perl Cookbook, and Python Cookbook).
(Review Data Last Updated: 2007-07-11 00:01:41 EST)
04-13-07 1 2\14
(Hide Review...)  Too long; get the Sams 10 minute series
Reviewer Permalink
Too long at 600 pages. Sure you'll understand SQL if you go through all 600 pages and understand them well. Heck that's true for any subject, including the Qu'ran. But who'se got the time? Get the Sams Teach Yourself SQL in 10 Minutes, Third Edition - Ben Forta; and in about a day you'll be half way towards mastery. But if you don't value your time, perhaps you're still a student rather than a professional, then by all means read this book.
(Review Data Last Updated: 2007-07-11 00:01:41 EST)
01-09-07 5 15\15
(Hide Review...)  Good tutorial on and selection of recipes solving problems with SQL
Reviewer Permalink
Ultimately, the goal of this book is to give you a glimpse of what can be done using SQL outside of what is considered the typical SQL problem domain. This text is unique in that the target audience is wide, incorporating all levels of SQL programmers as well as those who are completely unfamiliar with SQL.

Both complex and simple solutions are provided, and solutions for five different vendors are available when a common solution does not exist. These five databases are DB2 v.8, Oracle Database 10g (with the exception of a handful of recipes, the solutions will work for Oracle8i Database and Oracle9i Database as well), PostgreSQL 8, SQL Server 2005 and MySQL 5. All of the examples are built around a small set of tables containing employee data. This helps the reader get familiar with the example data, so that, having become familiar with the data, you can focus on the technique that each recipe illustrates.

Chapter 1, Retrieving Records, introduces very simple queries. Examples include how to use a WHERE clause to restrict rows from your result set, providing aliases for columns in your result set, using an inline view to reference aliased columns, using simple conditional logic, limiting the number of rows returned by a query, returning random records, and finding NULL values. Most of the examples are very simple, but some of them appear in later more complex recipes, so it's a good idea to read this chapter if you're relatively new to SQL or aren't familiar with any of the examples listed for this chapter.

Chapter 2, Sorting Query Results, introduces recipes for sorting query results. The ORDER BY clause is introduced and is used to sort query results. Examples increase in complexity ranging from simple, single-column ordering, to ordering by substrings, to ordering based on conditional expressions.

Chapter 3, Working with Multiple Tables, introduces recipes for combining data from multiple tables. If you are new to SQL or are a bit rusty on joins, this is a good chapter to read before going on to Chapter 5 and later. Joining tables is what SQL is all about; you must understand joins to be successful. Examples in this chapter include performing both inner and outer joins, identifying Cartesian productions, basic set operations (set difference, union, intersection), and the effects of joins on aggregate functions.

Chapter 4, Inserting, Updating, Deleting, introduces recipes for inserting, updating, and deleting data, respectively. Most of the examples are very straightforward, perhaps even pedestrian. Nevertheless, operations such as inserting rows into one table from another table, the use of correlated subqueries in updates, an understanding of the effects of NULLs, and knowledge of new features such as multi-table inserts and the MERGE command are extremely useful for your toolbox.

Chapter 5, Metadata Queries, introduces recipes for getting at your database metadata. It's often very useful to find the indexes, constraints, and tables in your schema. The simple recipes here allow you to gain information about your schema. Additionally, "dynamic" SQL examples are shown here as well, i.e., SQL generated by SQL.

Chapter 6, Working with Strings, introduces recipes for manipulating strings. SQL is not known for its string parsing capabilities, but with a little creativity, usually involving Cartesian products, along with the vast array of vendor-specific functions, you can accomplish quite a bit. Some of the more interesting examples include counting the occurrences of a character in a string, creating delimited lists from table rows, converting delimited lists and strings into rows, and separating numeric and character data from a string of alphanumeric characters.

Chapter 7, Working with Numbers, introduces recipes for common number crunching. You'll learn how easily window functions solve problems involving moving calculations and aggregations. Examples include creating running totals; finding mean, median, and mode; calculating percentiles; and accounting for NULL while performing aggregations.

Chapter 8, Date Arithmetic, is the first of two chapters dealing with dates. Being able to perform simple date arithmetic is crucial to everyday tasks. Examples include determining the number of business days between two dates, calculating the difference between two dates in different units of time (day, month, year, etc.), and counting occurrences of days in a month.

Chapter 9, Date Manipulation, is the second of the two chapters dealing with dates. In this chapter you will find recipes for some of the most common date operations you will encounter in a typical work day. Examples include returning all days in a year, finding leap years, finding first and last days of a month, creating a calendar, and filling in missing dates for a range of dates.

Chapter 10, Working with Ranges, introduces recipes for identifying values in ranges, and for creating ranges of values. Examples include automatically generating a sequence of rows, filling in missing numeric values for a range of values, locating the beginning and end of a range of values, and locating consecutive values.

Chapter 11, Advanced Searching, introduces recipes that are crucial for everyday development and yet sometimes slip through the cracks. These recipes are not any more difficult than others, yet many developers make very inefficient attempts at solving the problems these recipes solve. Examples from this chapter include finding knight values, paginating through a result set, skipping rows from a table, finding reciprocals, selecting the top n records, and ranking results.

Chapter 12, Reporting and Warehousing, introduces queries typically used in warehousing or generating complex reports. Examples include converting rows into columns and vice versa (cross-tab reports), creating buckets or groups of data, creating histograms, calculating simple and complete subtotals, performing aggregations over a moving window of rows, and grouping rows based on given units of time.

Chapter 13, Hierarchical Queries, introduces hierarchical recipes. Regardless of how your data is modeled, at some point you will be asked to format data such that it represents a tree or parent-child relationship. This chapter provides recipes accomplishing these tasks. Creating tree-structured result sets can be cumbersome with traditional SQL, so vendor-supplied functions are particularly useful in this chapter. Examples include expressing a parent-child relationship, traversing a hierarchy from root to leaf, and rolling up a hierarchy.

Chapter 14, Odds 'n' Ends, is a collection of miscellaneous recipes that didn't fit into any other problem domain, but that nevertheless are interesting and useful. This chapter is different from the rest in that it focuses on vendor-specific solutions only. This is the only chapter of the book where each recipe highlights only one vendor. In some cases, though, you'll be able to easily tweak a solution provided in this chapter to work for a platform not covered in the recipe.

Appendix A, Window Function Refresher, is a window function refresher along with a solid discussion of groups in SQL. Window functions are new to most, so it is appropriate that this appendix serves as a brief tutorial. Additionally, the use of GROUP BY in queries is a source of confusion for many developers. This chapter defines exactly what a SQL group is, and then proceeds to use various queries as proofs to validate that definition. The chapter then goes into the effects of NULLs on groups, aggregates, and partitions. Lastly, you'll find discussion on the more obscure and yet extremely powerful syntax of the window function's OVER clause (i.e., the "framing" or "windowing" clause).

Appendix B, Rozenshtein Revisited, is a tribute to David Rozenshtein, author of "The Essence of SQL". Appendix B focuses on some of the queries presented in "The Essence of SQL", and provides alternative solutions using window functions (which weren't available when The Essence of SQL was written) for those queries.

I highly recommend this book for anyone working with or interested in working with SQL. However, you should already be familiar with the theory behind database management or you will have trouble with this book.
(Review Data Last Updated: 2007-07-11 00:01:41 EST)
01-09-07 5 5\6
(Hide Review...)  Everything you need
Reviewer Permalink
The Cookbook series has always been a reference for users that had at least some knowledge of the subject.
But even if you are just starting out, you can get started right away with writing commands. And since this book covers the major SQL formats, you won't be left out. I bought this book because an application uses Oracle and I was able to do what I needed to do. The great thing about the cookbook series is that you don't have to go through alot of text to get what you want. You find your problem and apply the solution.
Great book!!!
(Review Data Last Updated: 2007-07-11 00:01:41 EST)
01-08-07 5 6\6
(Hide Review...)  Good tutorial on and selection of recipes solving problems with SQL
Reviewer Permalink
Ultimately, the goal of this book is to give you a glimpse of what can be done using SQL outside of what is considered the typical SQL problem domain. This text is unique in that the target audience is wide, incorporating all levels of SQL programmers as well as those who are completely unfamiliar with SQL.

Both complex and simple solutions are provided, and solutions for five different vendors are available when a common solution does not exist. These five databases are DB2 v.8, Oracle Database 10g (with the exception of a handful of recipes, the solutions will work for Oracle8i Database and Oracle9i Database as well), PostgreSQL 8, SQL Server 2005 and MySQL 5. All of the examples are built around a small set of tables containing employee data. This helps the reader get familiar with the example data, so that, having become familiar with the data, you can focus on the technique that each recipe illustrates.

Chapter 1, Retrieving Records, introduces very simple queries. Examples include how to use a WHERE clause to restrict rows from your result set, providing aliases for columns in your result set, using an inline view to reference aliased columns, using simple conditional logic, limiting the number of rows returned by a query, returning random records, and finding NULL values. Most of the examples are very simple, but some of them appear in later more complex recipes, so it's a good idea to read this chapter if you're relatively new to SQL or aren't familiar with any of the examples listed for this chapter.

Chapter 2, Sorting Query Results, introduces recipes for sorting query results. The ORDER BY clause is introduced and is used to sort query results. Examples increase in complexity ranging from simple, single-column ordering, to ordering by substrings, to ordering based on conditional expressions.

Chapter 3, Working with Multiple Tables, introduces recipes for combining data from multiple tables. If you are new to SQL or are a bit rusty on joins, this is a good chapter to read before going on to Chapter 5 and later. Joining tables is what SQL is all about; you must understand joins to be successful. Examples in this chapter include performing both inner and outer joins, identifying Cartesian productions, basic set operations (set difference, union, intersection), and the effects of joins on aggregate functions.

Chapter 4, Inserting, Updating, Deleting, introduces recipes for inserting, updating, and deleting data, respectively. Most of the examples are very straightforward, perhaps even pedestrian. Nevertheless, operations such as inserting rows into one table from another table, the use of correlated subqueries in updates, an understanding of the effects of NULLs, and knowledge of new features such as multi-table inserts and the MERGE command are extremely useful for your toolbox.

Chapter 5, Metadata Queries, introduces recipes for getting at your database metadata. It's often very useful to find the indexes, constraints, and tables in your schema. The simple recipes here allow you to gain information about your schema. Additionally, "dynamic" SQL examples are shown here as well, i.e., SQL generated by SQL.

Chapter 6, Working with Strings, introduces recipes for manipulating strings. SQL is not known for its string parsing capabilities, but with a little creativity, usually involving Cartesian products, along with the vast array of vendor-specific functions, you can accomplish quite a bit. Some of the more interesting examples include counting the occurrences of a character in a string, creating delimited lists from table rows, converting delimited lists and strings into rows, and separating numeric and character data from a string of alphanumeric characters.

Chapter 7, Working with Numbers, introduces recipes for common number crunching. You'll learn how easily window functions solve problems involving moving calculations and aggregations. Examples include creating running totals; finding mean, median, and mode; calculating percentiles; and accounting for NULL while performing aggregations.

Chapter 8, Date Arithmetic, is the first of two chapters dealing with dates. Being able to perform simple date arithmetic is crucial to everyday tasks. Examples include determining the number of business days between two dates, calculating the difference between two dates in different units of time (day, month, year, etc.), and counting occurrences of days in a month.

Chapter 9, Date Manipulation, is the second of the two chapters dealing with dates. In this chapter you will find recipes for some of the most common date operations you will encounter in a typical work day. Examples include returning all days in a year, finding leap years, finding first and last days of a month, creating a calendar, and filling in missing dates for a range of dates.

Chapter 10, Working with Ranges, introduces recipes for identifying values in ranges, and for creating ranges of values. Examples include automatically generating a sequence of rows, filling in missing numeric values for a range of values, locating the beginning and end of a range of values, and locating consecutive values.

Chapter 11, Advanced Searching, introduces recipes that are crucial for everyday development and yet sometimes slip through the cracks. These recipes are not any more difficult than others, yet many developers make very inefficient attempts at solving the problems these recipes solve. Examples from this chapter include finding knight values, paginating through a result set, skipping rows from a table, finding reciprocals, selecting the top n records, and ranking results.

Chapter 12, Reporting and Warehousing, introduces queries typically used in warehousing or generating complex reports. Examples include converting rows into columns and vice versa (cross-tab reports), creating buckets or groups of data, creating histograms, calculating simple and complete subtotals, performing aggregations over a moving window of rows, and grouping rows based on given units of time.

Chapter 13, Hierarchical Queries, introduces hierarchical recipes. Regardless of how your data is modeled, at some point you will be asked to format data such that it represents a tree or parent-child relationship. This chapter provides recipes accomplishing these tasks. Creating tree-structured result sets can be cumbersome with traditional SQL, so vendor-supplied functions are particularly useful in this chapter. Examples include expressing a parent-child relationship, traversing a hierarchy from root to leaf, and rolling up a hierarchy.

Chapter 14, Odds 'n' Ends, is a collection of miscellaneous recipes that didn't fit into any other problem domain, but that nevertheless are interesting and useful. This chapter is different from the rest in that it focuses on vendor-specific solutions only. This is the only chapter of the book where each recipe highlights only one vendor. In some cases, though, you'll be able to easily tweak a solution provided in this chapter to work for a platform not covered in the recipe.

Appendix A, Window Function Refresher, is a window function refresher along with a solid discussion of groups in SQL. Window functions are new to most, so it is appropriate that this appendix serves as a brief tutorial. Additionally, the use of GROUP BY in queries is a source of confusion for many developers. This chapter defines exactly what a SQL group is, and then proceeds to use various queries as proofs to validate that definition. The chapter then goes into the effects of NULLs on groups, aggregates, and partitions. Lastly, you'll find discussion on the more obscure and yet extremely powerful syntax of the window function's OVER clause (i.e., the "framing" or "windowing" clause).

Appendix B, Rozenshtein Revisited, is a tribute to David Rozenshtein, author of "The Essence of SQL". Appendix B focuses on some of the queries presented in "The Essence of SQL", and provides alternative solutions using window functions (which weren't available when The Essence of SQL was written) for those queries.

I highly recommend this book for anyone working with or interested in working with SQL. However, you should already be familiar with the theory behind database management or you will have trouble with this book.
(Review Data Last Updated: 2007-04-11 12:01:32 EST)
12-24-06 5 4\4
(Hide Review...)  Bring something new in my arsenal
Reviewer Permalink
You can hardly go wrong with a cookbook from O'Reilly; they invented the format and delivered many first class recipe books along the years. SQL Cookbook lives up to the expectations. The author covers five different RDMS, being a freelance consultant I fund this especially valuable, since I sometimes need to switch among different databases. The amount of explanations and recipes leveraging the window functions are, in my opinion, another major plus; window functions are still relatively new for me (I am an application developer, not a DBA), and seeing them in action bring something new in my arsenal.
(Review Data Last Updated: 2007-07-11 00:01:41 EST)
10-17-06 5 4\4
(Hide Review...)  Neatly written guide for Sql Developers
Reviewer Permalink
O'Reilly's SQL Cookbook is the reference I've seen for SQL developers and personally suggest all developers intrested in SQL to must read it. Modeled after a true cookbook, it offers many short snippets of SQL code designed to solve specific problems. You can pick and choose the components you need to help complete your SQL project. Each item in the cookbook is clearly explained in a well defined format. High recommendation for Sql Dev's. A must read.

(Review Data Last Updated: 2007-06-25 21:49:35 EST)
10-14-06 5 2\3
(Hide Review...)  Go get this book
Reviewer Permalink
It really helps when you need to find SQL query tips in your real projects
(Review Data Last Updated: 2007-03-25 06:49:39 EST)
09-20-06 5 3\3
(Hide Review...)  Good Book
Reviewer Permalink
This is the wonderful SQL book. When I read in Borders, I was suprised to see that this book covers so many useful topics and it covers 4 databases.

It introduces so many useful topics and describes SQL command in detail. I really like that.

I am waiting to see if the author can add the content of useful skills of "Stored Procedures" or "Triggers" in the future.
(Review Data Last Updated: 2007-03-25 06:49:39 EST)
08-25-06 5 3\3
(Hide Review...)  Excellent Recipes for both novice and expert programmers
Reviewer Permalink
I am really glad I bought this book. This book covers substantial amount of sql problems that you would practically come across.

-For each problem, the book illustrates the solution and the rationale behind it. It also discusses solution for different databases.
-Each problem/solution is discussed for MySQL, Oracle, PostgreSQL, DB2 and SQL Server.
-Best thing I like about the book is that it doesn't just discuss the solution but it also gives you enough details so that you understand the database specific behaviour. For e.g. 'rownum' concept in Oracle is very nicely explained with respect to the context.
-I have been writing SQLs for years. Still I came across very valuable techniques and tricks that I had not heard or used before buying this book.
-The explanation style used in this book is also very reader friendly. What I mean is a lot of technical books get very very technical and boring. I felt exactly the opposite while reading this book. If there is a concept that you should understand before book discusses it in details, this book makes sure that it is explained enough for you to dive into the details given later.

I would highly recommend this book for anyone looking to have a reference SQL book that would help them get answers to common and advanced SQL problems in day to day SQL programming.
(Review Data Last Updated: 2006-09-21 08:15:30 EST)
07-16-06 5 3\3
(Hide Review...)  "COOKING WITH SQL"
Reviewer Permalink
Are you an SQL novice, journeyman, expert or a non-SQL programmer? If you are, then this book is for you! Author Anthony Molinaro, has done an outstanding job of writing a practical book that gives you the reader, a glimpse of what can be done using SQL outside of what is considered the typical SQL problem domain..

Molinaro, begins by introducing very simple queries. Then, the author introduces recipes for sorting query results. Next, he introduces recipes for combining data from multiple tables. The author then introduces recipes for inserting, updating, and deleting data, respectively. He continues by introducing recipes for getting at your database metadata. Then, the author introduces recipes for manipulating strings. Next, he introduces recipes for common number crunching. He also deals with data arithmetic. The author continues by showing you recipes for some of the most common date operations you will encounter in a typical work day. Then, he introduces recipes for identifying values in ranges, and for creating ranges of values. Next, the author introduces recipes that are crucial for everyday development and yet sometimes slip through the cracks. He also introduces queries typically used in warehousing or generating complex reports. The author continues by introducing you to hierarchical recipes. Finally, the author focuses on vendor-specific solutions.

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.
(Review Data Last Updated: 2006-08-26 13:11:33 EST)
07-03-06 5 (NA)
(Hide Review...)  Excellent desktop resource book!
Reviewer Permalink
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
(Review Data Last Updated: 2006-07-17 14:18:10 EST)
06-15-06 5 2\2
(Hide Review...)  Love this cookbook
Reviewer Permalink
This is definitely a fantastic book. As a web developer in Kansas City, I have great need for providing my clients with great programming. This book is an integral part of my library.

My favorite topics in here are:
- Retrieving Records Section-really like searching for patterns
- Working with ranges..used this one with a client.
- Reporting (Great need for online businesses)

Thanks Anthony - Great book review from me!

Sean Morelli
RPG Designs, LLC - Kansas City Web Design firm
(Review Data Last Updated: 2006-07-11 04:50:00 EST)
06-14-06 5 2\2
(Hide Review...)  Make You Look SMARTER in SQL
Reviewer Permalink
I thought SQL was dull.

But this cookbook changed the way I thought about SQL.

There were a lot that I thought I can't do in SQL, but Anthony used lively, practical and interesting example to demonstrate the power of SQL, to prove that I'm wrong over and over again.

To me it is mind-blowing. And I definitely do look smarter in SQL now.
(Review Data Last Updated: 2006-07-11 04:50:00 EST)
06-05-06 2 1\6
(Hide Review...)  Quite inconsistent and confusing book
Reviewer Permalink
Maybe not a bad source for an exepienced SQL programmer, but very frustrating for a beginner. There's no such thing as "generic SQL"; regretfully, it's vendor-specific and doesn't really comply ANSI stndards...
(Review Data Last Updated: 2006-07-11 04:50:00 EST)
05-18-06 5 3\3
(Hide Review...)  OUTSTANDING!!!!
Reviewer Permalink
Chock full of SQL tips, tricks, and goodies, this is the kind of Cookbook that I would expect as it relates to this topic. Any SQL programmer could stand to learn from the best and learn the techniques that will make their DB code shine, and having this book by your side will only help you take the journey to greatness in the SQL world.

Required purchase for any SQL developer... period.

***** HIGHLY RECOMMENDED
(Review Data Last Updated: 2006-07-07 12:57:43 EST)
05-02-06 5 2\2
(Hide Review...)  For developers who know the basics of the SQL query language but don't know enough about its advanced capabilities
Reviewer Permalink
Anthony Molinaro's SQL Cookbook: Query Solutions And Techniques For Database Developers is for developers who know the basics of the SQL query language but don't know enough about its advanced capabilities. There's a lot which can be accomplished with SQL: developer Molinaro covers all the techniques and features which make this language important. From using pivot operators and MODEL clauses to creating histograms, summarizing data into buckets, and walking a string, SQL Cookbook uses a problem/solution format to allow for quick and easy referencing for troubleshooters, yet is basic enough for relative newcomers to learn from.
(Review Data Last Updated: 2006-07-07 12:57:43 EST)
03-16-06 5 1\2
(Hide Review...)  Excellent SQL book
Reviewer Permalink
I really like this book. 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 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.

(Review Data Last Updated: 2006-07-07 12:57:43 EST)
03-10-06 5 2\4
(Hide Review...)  It is an excellent book for sql tips
Reviewer Permalink
It is a great book and will show you some of the cool ways you can use sql to do some of the most complicated tasks which we usually think of in terms of a stored procedure
(Review Data Last Updated: 2006-07-07 12:57:43 EST)
02-28-06 5 3\3
(Hide Review...)  Finally another good cookbook for the arsenal!!!
Reviewer Permalink
A perfectly written SQL cookbook that both the SQL DBA and the casual SQL enthusiast can use. With common world examples this cookbook has helped me tremendously with daily SQL tasks and OLAP tuning. Nicely Done!
(Review Data Last Updated: 2006-07-07 12:57:43 EST)
02-06-06 5 4\11
(Hide Review...)  Sick Book
Reviewer Permalink
This book is awsome!! Dawg, your a sick writer. It helped me through out my course work. The author must be a genius!!!
(Review Data Last Updated: 2006-07-07 12:57:43 EST)
01-27-06 5 2\2
(Hide Review...)  SQL Cookbook by Anthony Molinaro
Reviewer Permalink
The book: SQL Cookbook by Anthony Molinaro, is an outstanding book. It is a book long overdue. Anthony provides solutions to everyday, real world problems with straight SQL for 5 databases: Oracle, DB2, SQL Server, PostgresSQL, and MySQL. I have also run some of his solutions in Sybase and Microsoft Access databases and those solutions worked, also. Next, I decided to run some of his code in Crystal Reports and Impromptu and that worked, also.

I recommend this book for all Developers, DBAs, Database Architects, SQL Programmers, SQL Experts, Report Writers, Power Users, and anyone who wishes to enhance and increase their knowledge in writing SQL. This is a "must have" book.
(Review Data Last Updated: 2006-07-02 14:27:11 EST)
01-26-06 5 5\5
(Hide Review...)  excellent explanations
Reviewer Permalink
the chapter on reporting and warehousing queries is what made me decide to pick up this book.

the author's approach to explaining queries is great.
the author takes his time explaining these queries step by step and showing what each construct of a query does.
But what i found most useful for understanding is that the author also shows what the result sets would look like WITHOUT specific constructs. by doing this, you see exactly what these constructs mean to the final result set, why the author uses them, and what the query would look like without them.

i find it easier to understand the big picture this way
as the author explains WHY certain parts of the query are necessary and does so by showing what the results look like without them as well.
a perfect example, the author spends 11 pages carefully explaining and breaking down single and multiple row pivots (also referred to as transpositions) by:
1. showing the steps to build these queries from scratch
2. showing what the result sets look like along the way
3. showing what changing specific aspects of the query means
to the final result set and intermediate result sets alike.
that's the key for me, not just explaining how changes effect the result set, but actually showing the intermediate result sets and how they change.

bottom line: the author doesnt rush through the explanations and doesn't make you feel like you should already see what's going on. i find it much easier to grasp complex queries this way.
(Review Data Last Updated: 2006-06-15 14:55:46 EST)
01-26-06 5 12\13
(Hide Review...)  Fantastic resource for anyone using SQL
Reviewer Permalink
This is a great book for anyone writing SQL. Get it right now.

Oh, you want a reason? Ok. The chapter on querying hierarchal data effeciently, which is the bane of all SQL programmers, is worth the money right there. Oh, yeah, and the other chapters are great too.

Get it. Right now.
(Review Data Last Updated: 2006-06-13 17:09:56 EST)
01-19-06 4 13\13
(Hide Review...)  Excellent book on SQL and the platforms recognized in this book!
Reviewer Permalink
This book is just fantastic. One really needs to read the inside cover pages to see what this book doesn't try to do. The relevant elements are:

Non-political (on several SQL-specific fronts)
Non-Pure ANSI (portability versus vendor-specific features)
Non-platform (I couldn't find a mention of a particular platform)

Basically, the book focuses on how to accomplish numerous SQL tasks using SQL and those features found on some of the top RDBMS vendors' products. It is selective in that the focus is constrained to MS SQL (platform obvious, but not mentioned that I could find) Server, DB2, MySQL, PostgresSQL and Oracle. I think that this well represents at least the 80/20 rule of who's running what RDBMS.

The book is a set of recipes for (usually) each of these platforms. Each recipe is a code-demonstrated "how-to" for accomplishing the given task. This is perfect for those who don't want to become DBAs and focus on learning "too" much about SQL, rather, want to use an example in their code to make it do the right thing.

The book is very well written and finished. It is a joy to read.

The one detraction that I can think of is that it would be nice to see all of the examples online at O'Reilly's web site so that we could "play around with them" somewhat without having to enter the database table contents and all of the SQL by hand. It "ain't that hard," but who's got the time to do it? I think that having the code available with the book would make it an excellent training tool for newcomers to SQL and those switching to a different product such as going from Oracle or MS SQL to MySQL or PostgresSQL. However, as it is, the book is a 4.5 stars product. If you're interested solely in MySQL, check out the MySQL Cookbook from O'Reilly.
(Review Data Last Updated: 2006-06-05 14:56:15 EST)
01-14-06 5 1\1
(Hide Review...)  Finally!
Reviewer Permalink
If ever there was a language that required someone make a cookbook it's SQL. The use of OLAP functions to solve problems when available is an intriguing approach. Great examples, realistic problems, piecewise explanations. Being able to see the different syntax for each platform is great. nicely done.
(Review Data Last Updated: 2006-05-18 11:12:20 EST)
01-13-06 5 8\9
(Hide Review...)  an eye opener for undergrads and grads alike
Reviewer Permalink
as a recent graduate i was surprised by the sql i came across
once i started working. as an undergrad i was required to use elmasri/navathe and felt that book did a nice job
of teaching database fundementals, but it really doesn't prepare you for real world sql.
other courses with end of semester and group projects
were realistic enough that the learning curve once you begin working is tiny.
not so, for sql. the sql you're taught is nothing close to the pollution that's out there.
this book does a great job showing and explaining real world sql, using a step by step approach.

the first 2 chapters were lame intros that i suggest you skip unless you're a complete noob.
things get interesting as early as chapter 3 when recipes like "performing joins/outer-joins
with aggregation" are introduced.

a very nice book that would be very useful as a supplement to any undergrad taking a database course
who wants to get a taste of real world sql.
(Review Data Last Updated: 2006-05-01 12:53:46 EST)
01-10-06 5 1\1
(Hide Review...)  Indispensable
Reviewer Permalink
Molinaro's book is an incredible resource, and sets a new standard. No matter how old a hand you are at SQL, you will learn a great deal from this book. I certainly have.
(Review Data Last Updated: 2006-03-10 08:51:34 EST)
  
                  Reader Reviews 1 - 33 of 33                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated