Synopses & Reviews
SQL is the language of databases. It's used to create and maintain database objects, place data into those objects, query the data, modify the data, and, finally, delete data that is no longer needed. Databases lie at the heart of many, if not most business applications. Chances are very good that if you're involved with software development, you're using SQL to some degree. And if you're using SQL, you should own a good reference or two.
Now available in an updated second edition, our very popular SQL Pocket Guide is a major help to programmers, database administrators, and everyone who uses SQL in their day-to-day work. The SQL Pocket Guide is a concise reference to frequently used SQL statements and commonly used SQL functions. Not just an endless collection of syntax diagrams, this portable guide addresses the language's complexity head on and leads by example. The information in this edition has been updated to reflect the latest versions of the most commonly used SQL variants including:
- Oracle Database 10g, Release 2 (includingthe free Oracle Database 10g Express Edition (XE))
- Microsoft SQL Server 2005
- MySQL 5
- IBM DB2 8.2
- PostreSQL 8.1 database
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
- PostgreSQLs 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
About the Author
Jonathan Gennick is an O'Reilly Media, Inc. editor specializing in database and programming titles. He writes extensively on database topics, and is the author of such successful books as: Oracle SQLPlus: The Definitive Guide, Oracle SQLPlus Pocket Reference, and Oracle SQLLoader: The Definitive Guide. Jonathan contributes regularly to Oracle Magazine, and frequently explores interesting SQL topics on his own website, http://gennick.com. Jonathan is also a member of The Oak Table Network (http://www.oaktable.net), a group of Oracle experts known for their scientific approach to administering and developing Oracle based systems.Jonathan got his start with relational database systems in 1990, first working with Ingres, and later with Digital's Rdb software. During that period he developed a fondness for SQL, and for the challenge of applying SQL creatively in ways that leveraged it's set-oriented capabilities.In 1994 Jonathan made the leap to Oracle, and is now often found writing about it. Recent projects include Oracle SQLLoader (O'Reilly Media, Inc., 2001); Oracle SQLPlus Pocket Reference (O'Reilly Media, Inc., 2000); Oracle SQLPlus: The Definitive Guide (O'Reilly Media, Inc., 1999); More recently, Jonathan has made forays into other database products, coauthoring Transact-SQL Cookbook (O'Reilly Media, Inc., 2002) and editing Practical PostgreSQL (O'Reilly Media, Inc., 2002).
Table of Contents
Praise for SQL Pocket Guide; Chapter 1: SQL Pocket Guide; 1.1 Introduction; 1.2 Analytic Functions; 1.3 CASE Expressions; 1.4 Datatypes; 1.5 Dataype Conversion; 1.6 Deleting Data; 1.7 Functions; 1.8 Grouping and Summarizing; 1.9 Hierarchical Queries; 1.10 Indexes, Creating; 1.11 Indexes, Removing; 1.12 Inserting Data; 1.13 Joining Tables; 1.14 Literals; 1.15 Merging Data (Oracle, DB2); 1.16 Nulls; 1.17 OLAP Functions; 1.18 Predicates; 1.19 Recursive Queries; 1.20 Regular Expressions; 1.21 Selecting Data; 1.22 Subqueries; 1.23 Tables, Creating; 1.24 Tables, Modifying; 1.25 Tables, Removing; 1.26 Transaction Management; 1.27 Union Queries; 1.28 Updating Data; 1.29 Window Functions;