Table of contents for SQL pocket guide / Jonathan Gennick.


Bibliographic record and links to related information available from the Library of Congress catalog
Note: Electronic data is machine generated. May be incomplete or contain other coding.


Counter
Organization of This Book                                2
Feedback Needed!                                         2
Conventions                                              3
Acknowledgments                                          4
Example Data                                             4
Analytic Functions                                           6
CASE Expressions                                             6
Simple CASE Expressions                                  6
Searched CASE Expressions                                6
Datatypes                                                    7
Character String Types                                   7
Decimal Types                                            8
Binary Integer Types                                     8
Datetime Types                                           9
Dataype Conversion                                          11
Standard CAST Function                                  11
Standard EXTRACT Function                               12
Datetime Conversions (Oracle)                           12
Numeric Conversions (Oracle)                            16
Datetime Conversions (DB2)                              17
Numeric Conversions (DB2)                               20
Datetime Conversions (SQL Server)                       21
Numeric Conversions (SQL Server)                        25
Datetime Conversions (MySQOL)                           26
Numeric Conversions (MySQL)                             30
Datetime Conversions (PostgreSQL)                       31
Numeric Conversions (PostgreSOL)                        33
Deleting Data                                                35
Deleting in Order (My5SL)                                35
Deleting Al Rows                                         36
Deleting from Views and Subqueries                       37
Returning Deleted Data (Oracle, DB2)                     37
Double-FROM (SQL Server)                                 38
uncti ons                                                   39
Datetime Functions (Oracle)                              39
Datetime Functions (DB2)                                 42
Datetime Functions (SQL Server)                          43
Datetime Functions (MySOL)                               44
Datetime Functions (PostgreSQL)                          45
"Numenric and Math Functions (All Platforms)             48
Trigonometric Functions (All Platforms)                  50
String Functions                                         50
GREATEST and LEAST (Oracle, PostgreSQL)                  55
roupin and Summarizing                                      56
Aggregate Functions                                      56
GROUP BY                                                 57
iseul GROUP BY Techniques                                59
HAVING                                                   60
GROUP BY Extensions (Oracle, DB2)                        61
GROUP BY Extensions (SQL Server)                         64
Hierarchical Queries                                         65
Recursive WITH (SOL Server, DB2)                         66
CONNECT BY (Oracle)                                      68
Indes, Creating                                              74
Indexe, Removing                                             74
sert ing Data   .                                            75
Single-Row inserts                                       75
Multi-Row Inserts (DB2, MySQL)                           76
Insert Targets                                           76
Subquery Inserts                                         76
Returning Inserted Values (Orade, DB2)                   77
Multi-Table inserts (Oracle).                            78
J0oiu  Tables                                               80
The Concept of a Join                                    80
Cross Joins                                              81
InnerJoins                                               82
The USING Clause (Oraclde, MySL, PostgreSQL)             83
Natural Joins (Oracle, MySOL, PostgreSQL)                84
Non-Equi-Joins                                           85
OuterJoins                                               86
Literals                                                   89
Text Literals                                          90
Numeric Literals                                       92
Datetime Literals (Oracle, MySQL, PostgreSQL)          92
Datetime Interval Literals                             93
Merging Data (Oracle, DB2)                                 93
Nulls                                                      96
Predicates for Nulls                                   96
Using CASE with Nulls                                  96
Using the COALESCE Function                            97
Functions for Nulls (Oracle)                           97
Functions for Nulls (DB2)                              98
Functions for Nulls (SQL Server)                       98
Functions for Nulls (MySQL)                            99
Functions for Nulls (PostgreSQL)                      100
OLAP Functions                                            100
Predicates                                                100
EXISTS Predicates                                     101
!N Predicates                                         102
BETWEEN Predicates                                    102
LIKE Predicates                                       103
Recursive Queries                                         104
Regular Expressions                                       104
Regular Expressions (Oracle)                          104
Regular Expressions (SQL Server)                      108
Regular Expressions (MySQL)                           108
Regular Expressions (PostgreSQL)                      110
Selecting Data                                            115
The SELECT Clause                                     115
ALL and DISTINCT                                      120
The FROM Clause                                       121
The WHERE Clause                                      124
The GROUP BY Clause                                   124
The HAVING Clause                                     124
The ORDER BY Clause                                   125
Subqueries                                                126
The WITH Clause (Oracle, SQL Server, DB2)             127
Tables, Creating                                          130
Creating a Table (Oracle)                             130
Creating a Table (DB2)                                132
Creating a Table (SOL Srver)                          133
Creating a Table (MySQL)                             133
Creating a Table (PostgreSQL)                        134
Tables, Modi inog                                        135
Modifying a Table (Oracle)                           135
Modifying a Table (DB2)                              136
Modifying a Table (SQL Server)                       137
Modifying a Table (MySQL)                            138
Modifying a Table (PostgreSQL)                       139
Tables, Removing                                         140
'ransation Management                                   141
Autocommit Mode (SQL Server, MySQL, PostgreSQL)      141
Starting a Transaction                               142
Ending a Transaction                                 146
Aborting a Transaction                               147
Aborting to a Transaction Savepoint                  148
Union Queries                                           148
UMION and UNION ALL                                  149
ORDER BY in Union Queries                            150
Names and Datatypes in a Union                       150
Order of Evaluation                                  151
EXCEPT (or MINUS)                                    152
INTERSECT                                            153
Updating Data                                            155
Simple Updates                                       155
New Values from a Subquery                           156
Updating Views and Subqueries                        157
UPDATE FROM Clause (SQL Server, PostgreSQL)          157
Returning Updated Data (Oracle, DB2)                 158
Window Functions                                         158
Defining a Summary Window (Oracle, DB2, SQL Server)  159
Ordering and Ranking Within a Window (Oracle, DB2,
SQL Server)                                          1 60
Comparing Values Across Rows (Oracle)                162
Summarizing over a Moving Window (Oracle, DB2)       164
Window Function Syntax (Oraclde                      164
Window Function Syntax (DB2)                         165
Window Function Evaluation and Placement             166



Library of Congress subject headings for this publication: SQL (Computer program language)Relational databases, Database management