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 (including the free Oracle Database 10g Express Edition (XE))
- Microsoft SQL Server 2005
- MySQL 5
- IBM DB2 8.2
- PostreSQL 8.1 database
Synopsis
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
Synopsis
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
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 SQL*Loader: 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 SQL*Plus: 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
Chapter 1: SQL Pocket Guide; 1.1 Introduction; 1.2 Analytic Functions; 1.3 CASE Expressions: Simple; 1.4 CASE Expressions: Searched; 1.5 CAST Function; 1.6 CONNECT BY Queries; 1.7 Data Type Conversion; 1.8 Data Types: Binary Integer; 1.9 Data Types: Character String; 1.10 Data Types: Datetime; 1.11 Data Types: Decimal; 1.12 Datetime Conversions: DB2; 1.13 Datetime Conversions: MySQL; 1.14 Datetime Conversions: Oracle; 1.15 Datetime Conversions: PostgreSQL; 1.16 Datetime Conversions: SQL Server; 1.17 Datetime Functions: DB2; 1.18 Datetime Functions: MySQL; 1.19 Datetime Functions: Oracle; 1.20 Datetime Functions: PostgreSQL; 1.21 Datetime Functions: SQL Server; 1.22 Deleting Data; 1.23 EXTRACT Function; 1.24 GREATEST; 1.25 Grouping and Summarizing; 1.26 Hierarchical Queries; 1.27 Indexes, Creating; 1.28 Indexes, Removing; 1.29 Inserting Data; 1.30 Joining Tables; 1.31 LEAST; 1.32 Literals; 1.33 Merging Data; 1.34 Nulls; 1.35 Numeric Conversions: DB2; 1.36 Numeric Conversions: MySQL; 1.37 Numeric Conversions: Oracle; 1.38 Numeric Conversions: PostgreSQL; 1.39 Numeric Conversions: SQL Server; 1.40 Numeric/Math Functions; 1.41 OLAP Functions; 1.42 Pivoting and Unpivoting; 1.43 Predicates; 1.44 Recursive Queries; 1.45 Regular Expressions; 1.46 Selecting Data; 1.47 String Functions; 1.48 Subqueries; 1.49 Tables, Creating; 1.50 Tables, Dropping; 1.51 Tables, Modifying; 1.52 Transaction Management; 1.53 Union Queries; 1.54 Updating Data; 1.55 Window Functions;