SQL Pocket Guide, 3rd Edition
A Guide to SQL Usage
Publisher: O'Reilly Media
Final Release Date: November 2010
Pages: 206

If you're a programmer or database administrator who uses SQL in your day-to-day work, this popular pocket guide is the ideal on-the-job reference. You'll find many examples that address the language's complexity, along with key aspects of SQL used in IBM DB2 Release 9.7, MySQL 5.1, Oracle Database 11g Release 2, PostgreSQL 9.0, and Microsoft SQL Server 2008 Release 2.

SQL Pocket Guide describes how these database systems implement SQL syntax for querying, managing transactions, and making changes to data. It also shows how the systems use SQL functions, regular expression syntax, and type conversion functions and formats.

All example SQL statements in this book execute against a set of tables, with data that you can quickly download. The third edition covers important database changes, including:

  • Oracle's support of the recursive WITH syntax, and addition of PIVOT and UNPIVOT operators
  • Functions new to Oracle, such as LISTAGG, NTH_VALUE, and more
  • PostgreSQL’s support of recursive WITH and some window functions
  • DB2 syntax and datatypes, some compatible with Oracle
  • MySQL features such as the TIMESTAMP type and the TO_SECONDS function
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
O'Reilly MediaSQL Pocket Guide, 3rd Edition
 
4.1

(based on 13 reviews)

Ratings Distribution

  • 5 Stars

     

    (2)

  • 4 Stars

     

    (10)

  • 3 Stars

     

    (1)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

92%

of respondents would recommend this to a friend.

Pros

  • Concise (10)
  • Easy to understand (10)
  • Helpful examples (10)
  • Well-written (9)
  • Accurate (7)

Cons

    Best Uses

    • Intermediate (9)
    • Novice (7)
    • Student (7)
    • Expert (5)
      • Reviewer Profile:
      • Developer (11), Sys admin (4)

    Reviewed by 13 customers

    Sort by

    Displaying reviews 1-10

    Back to top

    Previous | Next »

     
    5.0

    Best Explanation of Group-By and Aggrega

    By David

    from Boston, MA

    About Me Developer

    Verified Buyer

    Pros

    • Accurate
    • Concise
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice
      • Student

      Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

      This little book taught me better than any other source how to understand Group-By and aggregation in SQL. I'm still not sure how they accomplished this, but accomplish it they did. It's filled with just what I've needed. I remembered reading the simple paragraphs in a friend's copy, and, when I was lining up a job interview I thought it wise to order my own copy just so that I refresh my own understanding of this (note: I've been programming with databases since the network database models and the earliest RDBMS engines--and, I still had trouble formulating the proper SQL for grouping).

       
      4.0

      Well written

      By Jack of all trades

      from UK

      About Me Jackofalltrades, Maker

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Easy to understand
      • Helpful examples
      • Well-written

      Cons

        Best Uses

          Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

          i bought the SQL Pocket Guide as a desktop reference but liked the intelligent and accessible way it was written so much that I downloaded the example SQL and worked my way through and played with many of the examples which brought my confidence and competence levels up as an enjoyable side-effect.

           
          5.0

          Well thought-out

          By Martin le Paddler

          from Hobart , TAS, Australia

          About Me Designer, Developer

          Pros

          • Accurate
          • Concise
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate
            • Novice
            • Student

            Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

            I already had the previous version but am even happier with the new one. If you are working across different versions of SQL (eg my background is Oracle but I am am writing SQL against DB2) this is really good comparator of the SQL variants.

            (0 of 2 customers found this review helpful)

             
            3.0

            SQL Pocket Guide

            By Smurphy

            from AZ

            About Me Developer

            Verified Reviewer

            Pros

            • Accurate

            Cons

              Best Uses

              • Intermediate

              Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

              SQL Pocket Guide 3rd edition, by jonathan Gennick

              Is just as it states a pocket guide. The content of the book is setup in a way that it is easy to find what you are looking for. It gives you examples in Oracle, DB2, PostgreSQL, SQL Server and MySQL. It is a helpfull tool to give you the syntax you are looking for.

              (1 of 1 customers found this review helpful)

               
              4.0

              Must Have IT Tool Kit for DBA or Develop

              By extofer

              from Colorado Springs, CO

              About Me Developer

              Verified Reviewer

              Pros

              • Easy to understand
              • Helpful examples
              • Well-written

              Cons

                Best Uses

                • Expert
                • Intermediate
                • Novice
                • Student

                Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                Jonathan Gennick's SQL Pocket Guide is a seamless guide any Database Admin or developer, expert or beginner alike, should have in their IT toolbox. I recall when I was in the university; I picked up a "learn SQL in 24 hours" book as a supplementary to our curriculum book. Had I had this pocket guide then, I would have most certainly struggled less. Most recently I been developing .Net applications to a Pervasive SQL Database, and even with years of Microsoft SQL Server experience, this reference book has been on my side.
                SQL is a platform independent database language, this guide will provide guidance and examples for Oracle, DB2, SQL Server, MySQL and PostgreSQL. You can also download code sample for all the mentioned platforms. Moreover, the organization of the book will indicate platform specifics, for instance, Data types spans several pages to distinguish between the various database platforms. The book is structured in alphabetical order by commands, this makes it easier for when you know you want to write a UNION but don't remember the syntax, you're sure to find it towards the end of the book. At times it may seem there are superfluous references to databases you don't work with, nonetheless, it is a Pocket Book primarily for reference and I won't hesitate in recommending it.

                 
                4.0

                Must have for the Database Butterfly

                By George Sawyer

                from Minneapolis, MN

                About Me Educator

                Verified Reviewer

                Pros

                • Compact
                • Concise
                • Helpful examples

                Cons

                  Best Uses

                  • Intermediate
                  • Student

                  Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                  The SQL Pocket Guide (3rd edition) by Jonathan Gennick (O'Reilly, 2010) is a must have for the database butterfly. I move among several DBMS on an almost daily basis. Once in a while I need a refresh on how one flavor of SQL differs from another. In comes the Pocket Guide. The Guide covers the latest versions of DB2, MySQL, Oracle, PostgreSQL, and Microsoft SQL Server. Gennick points out where commands and syntax vary from one platform to another and which commands are unique to certain platforms or versions. Examples of where these differences are tricky and where this book comes in handy are in areas like date/time and number conversion. This Guide is a short, abbreviated reference text which doesn't pretend to be a comprehensive reference. For comprehensive you will definitely want the SQL in a Nutshell (In a Nutshell (O'Reilly)).

                  While great for quick reference it is not intended to be a textbook. It can certainly be used as a refresher and has nice, short explanations of each command together with the examples. To find commands you will really want to already have an idea of what you are looking for and will need the table of contents and the index. If you are using an ebook format the search capability makes it an even handier reference text.

                  Disclaimer: I was provided a copy of this text by the publisher for review.

                   
                  4.0

                  Great working reference

                  By Joshua

                  from Lynnwood, WA

                  About Me Developer, Maker, Sys Admin

                  Verified Reviewer

                  Pros

                  • Accurate
                  • Concise
                  • Easy to understand
                  • Helpful examples
                  • Well-written

                  Cons

                    Best Uses

                    • Intermediate

                    Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                    SQL Pocket Guide is exactly that, a small guide to most things SQL. You won't find a lot of background or extraneous content. Instead you'll get good examples of SQL syntax for nearly every SQL command supported by PostgreSQL, MySQL, Oracle, DB2 and Microsoft SQL Server.

                    I've been using this book daily at work, and while it doesn't officially support the SQL database engine we use, I've found it to be most helpful. This isn't the type of book you'd sit down and read. It is meant to be a reference, but I find the content to be interesting enough that I often read about an extra command or two after the command I was looking for.

                    Don't buy this book (at least not first) if you are new to SQL. You need a working knowledge of SQL and relational databases to make the most of this. But if you do work with SQL on even a semi-regular basis I really recommend it.

                    The only thing I'd like to see changed is adding support for SQLite. It is, after all, by numbers of installations, the most popular SQL engine in the world. Plus it is the one I prefer to use for most of my projects. Still much of the content is applicable, but it may take some trial-and-error to find the precise syntax.

                     
                    4.0

                    Excellent How-to-do Cookbook

                    By Dozza

                    from Sydney, Australia

                    About Me Developer

                    Verified Reviewer

                    Pros

                    • Accurate
                    • Concise
                    • Easy to understand
                    • Well-written

                    Cons

                      Best Uses

                      • Intermediate
                      • Novice
                      • Student

                      Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                      Pretty much a 'cookbook', is why I decided to review this book, being a big fan of other O'Reilly cookbooks. I am not one to want to read up on basics when you have to skip pages and chapters. With a reference book like SQL Pocket Guide, the author does a great job with this third-edition in dividing the chapters according to function and purpose of a task, from trying to remember how to do the different types of JOINS, to DateTime conversions working with Cubes.

                      Jonathan Gennick doesnt waffle on, he provides a brief introduction to the function, then gives you a usage example, and usually an expected results output. This reference text is great for students or part-time developers, as well as even the more intermediary-level ones, as it provides all the chapters and content for most of the tasks one would need to do on SQL, as far as PL/SQL goes, but perhaps one would need a more vendor-specific book for vendor-specific tasks, such as when working with Oracle or MySQL. Jonathan does provide some footnotes on specific quirks that certain vendor-databases do, such as Oracle supporing some proprietary CONNECT BY syntax if it means the reader would be able to tap into doing something thats more powerful, even if it's not applicable across all the other databases.

                      Overall I am happy with this book and for me the generic SQL book suffices, as I don't tend to do many SQL administration tasks, so having access to the neat and powerful SQL Querying is good enough for me. I would certainly recommend this book to anyone who would need to work with SQL, at a casual or more regular periods.

                      (0 of 1 customers found this review helpful)

                       
                      4.0

                      Good overview of the SQL language

                      By Benjamin Williams

                      from Jonesboro, AR

                      About Me Developer

                      Verified Reviewer

                      Pros

                      • Concise
                      • Easy to understand

                      Cons

                        Best Uses

                        • Novice
                        • Student

                        Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                        SQL Pocket Guide is a way of getting to know the SQL language on a variety of common platforms. You quickly get to know each keyword and the output you should expect. You will not, however, learn the "best" way to write SQL code.

                        Gennick in this third edition covers Oracle, DB2, SQL Server, MySQL, and PostgresSQL keywords; some in depth some with "see your vendor's documentation". His overview is similar to what I would expect to get from a User Group lecture or a one day class at a University. If you are new to SQL code you should be able to understand keywords meanings and their usage.

                        The layout of chapters is by subject and then by keyword, so that you learn what SELECT, TIMESTAMP, and INSERT do. Gennick informs you of vendor differences but there is not a summery section. Some areas like date and time would make such a table nearly unusable as "Datetime support varies wildly amount platforms; commonality is virtually nonexistent." SQL Pocket Guide is a good overview of the SQL language for the most common vendors.

                        Reviewed as part of the O'Reilly Blogger Review Program.

                         
                        4.0

                        You will appreciate having it close.

                        By Horacio Nuñez

                        from Havana, Cuba

                        About Me Developer, Sys Admin

                        Pros

                        • Concise
                        • Easy to understand
                        • Helpful examples
                        • Well-written

                        Cons

                          Best Uses

                          • Expert
                          • Intermediate

                          Comments about O'Reilly Media SQL Pocket Guide, 3rd Edition:

                          The SQL Pocket Guide isn't a mandatory book to have in your desk because you can always take a look at good documentation from a database vendor, but the more databases you need to code against it, the more you will appreciate having it close to quickly find the information you need to resume your work. That is, when you read this book, you skip a lot of specifics about each database engine to concentrate in the practical aspects of SQL programming.

                          For those who have a hard copy, the organization of the book will turn out to be very useful, since every section name matches common practices of SQL. Some sections, like the ones dedicated to SELECT, Pivoting, and Joins, shine for including a concise and clear description of the concept at hand. Other sections like those discussing regular expressions, window (olap) functions, date and time functions, and data type conversions, will well be worth the cost of the book, since they merge all the know-how's required to use these (ubiquitous) features in a couple of pages.

                          I can't conclude my review without mentioning that in the process of reading it I found a few minor errors, albeit that fact, I think the purpose of the author to fit a great amount of information regarding the five major database engines in a short guide, has been achieved.

                          I rate this book with four stars and I would recommend it to anyone working actively on SQL, especially if the domain of work involves more than one database vendor.

                          Displaying reviews 1-10

                          Back to top

                          Previous | Next »

                           
                          Buy 2 Get 1 Free Free Shipping Guarantee
                          Buying Options
                          Immediate Access - Go Digital what's this?
                          Ebook: $11.99
                          Formats:  APK, DAISY, ePub, Mobi, PDF
                          Print & Ebook: $16.49
                          Print: $14.99