SQL Pocket Guide
Author: Jonathan Gennick
This pocket guide presents the most crucial informationabout SQL in a compact and easily accessible format, covering the four commonly used SQL variantsOracle, IBM DB2, Microsoft SQL Server, and MySQL. Topics include: Data manipulation statements (SELECT, DELETE, INSERT, UPDATE, MERGE) and transaction control statements (START TRANSACTION, SAVEPOINT, COMMIT, ROLLBACK).
Common SQL functions (date, numeric, math, trigonometric, string, conversion, aggregate) Such topics as literals, NULLs, CASE expressions, datatype conversion, regular expressions, grouping and summarizing data, joining tables, and writing queries (hierarchical, recursive, union, flashback) and subqueries.
Instead of presenting complex and confusing syntax diagrams, the book teaches by example, showing the SQL statements and options that readers are most like to use. All example data is available on the O'Reilly web site.
"If you need fast, accurate SQL information, with examples for multiple database engines, be sure to check out this book."
Chris Kempster, Senior DBA and author of SQL Server 2000 for the Oracle DBA
Table of Contents:
Introduction | 1 | |
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 | 1 | |
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 (MySQL) | 26 | |
Numeric Conversions (MySQL) | 30 | |
Datetime Conversions (PostgreSQL) | 31 | |
Numeric Conversions (PostgreSQL) | 33 | |
Deleting Data | 35 | |
Deleting in Order (MySQL) | 35 | |
Deleting All Rows | 36 | |
Deleting from Views and Subqueries | 37 | |
Returning Deleted Data (Oracle, DB2) | 37 | |
Double-FROM (SQL Server) | 38 | |
Functions | 39 | |
Datetime Functions (Oracle) | 39 | |
Datetime Functions (DB2) | 42 | |
Datetime Functions (SQL Server) | 43 | |
Datetime Functions (MySQL) | 44 | |
Datetime Functions (PostgreSQL) | 45 | |
Numeric and Math Functions (All Platforms) | 48 | |
Trigonometric Functions (All Platforms) | 50 | |
String Functions | 50 | |
Greatest and Least (Oracle, PostgreSQL) | 55 | |
Grouping and Summarizing | 56 | |
Aggregate Functions | 56 | |
Group by | 57 | |
Useful Group by Techniques | 59 | |
Having | 60 | |
Group by Extensions (Oracle, DB2) | 61 | |
Group by Extensions (SQL Server) | 64 | |
Hierarchical Queries | 65 | |
Recursive With (SQL Server, DB2) | 66 | |
Connect by (Oracle) | 68 | |
Indexes, Creating | 74 | |
Indexes, Removing | 74 | |
Inserting Data | 75 | |
Single-Row Inserts | 75 | |
Multi-Row Inserts (DB2, MySQL) | 76 | |
Insert Targets | 76 | |
Subquery Inserts | 76 | |
Returning Inserted Values (Oracle, DB2) | 77 | |
Multi-Table Inserts (Oracle) | 78 | |
Joining Tables | 80 | |
The Concept of a Join | 80 | |
Cross Joins | 81 | |
Inner Joins | 82 | |
The Using Clause (Oracle, MySQL, PostgreSQL) | 83 | |
Natural Joins (Oracle, MySQL, PostgreSQL) | 84 | |
Non-Equi-Joins | 85 | |
Outer Joins | 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 | |
In 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 (SQL Server) | 133 | |
Creating a Table (MySQL) | 133 | |
Creating a Table (PostgreSQL) | 134 | |
Tables, Modifying | 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 | |
Transaction 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 | |
Union 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) | 160 | |
Comparing Values Across Rows (Oracle) | 162 | |
Summarizing over a Moving Window (Oracle, DB2) | 164 | |
Window Function Syntax (Oracle) | 164 | |
Window Function Syntax (DB2) | 165 | |
Window Function Evaluation and Placement | 166 | |
Index | 167 |
Book about: Rodales Illustrated Encyclopedia of Herbs or The Supermarket Diet
Windows XP for Dummies Quick Reference
Author: Greg Harvey PhD
Next to your keyboard and mouse, this could be your most important accessory. Just keep it next to your keyboard and your mouse and refer to it to capitalize on the terrific capabilities at your fingertips with Windows XP. Windows XP For Dummies Quick Reference Second Edition covers the latest updates to Windows XP, including enhanced security and changes to Internet Explorer. It starts with the basics for true beginners, goes through everyday stuff, and progresses to the Web, accessories, and the control panel. After a quick introduction to the desktop, My Documents, dialogue boxes, and other basic info, you’ll explore:
• Customizing your desktop
• Saving music with Windows Media Player
• Browsing drives, folders and files
• Dragging, dropping, cutting, and pasting
• Playing music, videos and movies
• Browsing with Internet Explorer
• Sending and receiving e-mails
• Using Windows Accessories
Written by Greg Harvey, author of Excel 2002 For Dummies and more than 50 other computer books, Windows XP For Dummies Quick Reference, 2nd Edition is so clear and concise it turns computer phobes into computer geeks with step-by-step guides to:
• Using the Home Networking Wizard so two or more home computers can share a single Internet connection and other resources
• Creating slideshows with your graphics files
• Producing videos with Windows Movie Maker accessory program
• Downloading Microsoft Reader free and then downloading eBooks (many are free) and saving themin My Library
• Using the link to the Photo Printing Wizard to format and print your digital photos
• Using Windows Media Player to play audio, video, and animation files you’ve saved, play Internet radio stations, view trailers for upcoming movies, and play MP3 audio files you’ve downloaded
Complete with a glossary and index, Windows XP For Dummies Quick Reference doesn’t delve into the technology and terminology: it sticks to exploring the things Windows XP lets you do and describing how to!
No comments:
Post a Comment