Free Downloads
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 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 outPowerful, database-specific features such as SQL Server's PIVOT and UNPIVOT operators, Oracle's MODEL clause, and PostgreSQL's very useful GENERATE_SERIES functionPivoting rows into columns, reverse-pivoting columns into rows, using pivoting to facilitate inter-row calculations, and double-pivoting a result setBucketization, 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 techniquesThe technique of walking a string, which allows you to use SQL to parse through the characters, words, or delimited elements of a stringWritten 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.

Series: Cookbooks (O'Reilly)

Paperback: 636 pages

Publisher: O'Reilly Media; 1 edition (December 26, 2005)

Language: English

ISBN-10: 0596009763

ISBN-13: 978-0596009762

Product Dimensions: 7 x 1.4 x 9.2 inches

Shipping Weight: 2.3 pounds (View shipping rates and policies)

Average Customer Review: 4.6 out of 5 stars  See all reviews (89 customer reviews)

Best Sellers Rank: #73,990 in Books (See Top 100 in Books) #3 in Books > Computers & Technology > Databases & Big Data > Other Databases #12 in Books > Computers & Technology > Databases & Big Data > Data Warehousing #31 in Books > Computers & Technology > Databases & Big Data > SQL

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.

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.

SQL: Learn SQL In A DAY! - The Ultimate Crash Course to Learning the Basics of SQL In No Time (SQL, SQL Course, SQL Development, SQL Books, SQL for Beginners) SQL: QuickStart Guide - The Simplified Beginner's Guide To SQL (SQL, SQL Server, Structured Query Language) SQL Cookbook (Cookbooks (O'Reilly)) Free Cookbooks: Box Set: The Complete Healthy And Delicious Recipes Cookbook Box Set(30+ Free Books Included!) (Free Cookbooks, Free, Cookbooks, Recipes, Easy, Quick, Cooking,) SQL: Beginner's Guide for Coding SQL (database programming, computer programming, how to program, sql for dummies, java, mysql, The Oracle, python, PHP, ... (HTML, Programming, Coding, CSS Book 7) JUNOS Cookbook (Cookbooks (O'Reilly)) bash Cookbook: Solutions and Examples for bash Users (Cookbooks (O'Reilly)) XSLT Cookbook (Cookbooks (O'Reilly)) Excel Scientific and Engineering Cookbook (Cookbooks (O'Reilly)) BILL O'REILLY - SERIES READING ORDER (SERIES LIST) - IN ORDER: KILLING JESUS, KILLING PATTON, KILLING LINCOLN, KILLING KENNEDY, KILLING REAGAN, HITLER'S LAST DAYS, THE O'REILLY FACTOR & MANY MORE! Haunted Tales - A Mary O'Reilly Paranormal Mystery - Book Fifteen (Mary O'Reilly Series 15) Deadly Circumstances - A Mary O'Reilly Paranormal Mystery (Book 16) (Mary O'Reilly Paranormal Mysteries) Frayed Edges - A Mary O'Reilly Paranormal Mystery (Book Seventeen) (Mary O'Reilly Paranormal Mysteries Series 17) Anti Inflammatory Cookbook - 50 Slow Cooker Recipes With Anti - Inflammatory Ingredients - (Great For Gout Relief!) Crockpot Recipes, Slow Cooker Recipes, (Low Cooker Cookbooks, Crockpot Cookbooks) Recipes: Box Set: The Complete Healthy And Delicious Recipes Cookbook Box Set(30+ Free Books Included!) (Recipes, Healthy Cooking, Recipe Books, Diets, Cooking, Cookbooks, Diet Cookbooks,) Best of the Best from Hawaii Cookbook: Selected Recipes from Hawaii's Favorite Cookbooks (Best of the Best State Cookbooks) MySQL Pocket Reference: SQL Statements, Functions and Utilities and more (Pocket Reference (O'Reilly)) Pro SQL Server 2012 BI Solutions (Expert's Voice in SQL Server) SQL: The Ultimate Beginners Guide: Learn SQL Today SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL (3rd Edition)