Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
1Activity

Table Of Contents

Book Editions
Quick Find
Index of Concepts
Introduction to SQL
Syntax Diagram Conventions
SQL Components
DB2 Objects
DB2 Data Types
Date/Time Arithmetic
DB2 Special Registers
Distinct Types
SELECT Statement
FETCH FIRST Clause
Quotes and Double-quotes
SQL Predicates
Basic Predicate
Quantified Predicate
BETWEEN Predicate
EXISTS Predicate
IN Predicate
LIKE Predicate
NULL Predicate
Special Character Usage
Precedence Rules
CAST Expression
VALUES Clause
CASE Expression
Data Manipulation Language
Insert
Update
Delete
Select DML Changes
Merge
Compound SQL
Introduction
Statement Delimiter
SQL Statement Usage
DECLARE Variables
FOR Statement
GET DIAGNOSTICS Statement
IF Statement
ITERATE Statement
LEAVE Statement
SIGNAL Statement
WHILE Statement
Other Usage
Trigger
Scalar Function
Table Function
Protecting Your Data
Sample Application
Enforcement Tools
Distinct Data Types
Customer-Balance Table
US-Sales Table
Triggers
Conclusion
Column Functions
Column Functions, Definitions
CORRELATION
COUNT
COUNT_BIG
COVARIANCE
GROUPING
REGRESSION
STDDEV
VAR or VARIANCE
OLAP Functions
OLAP Functions, Definitions
Ranking Functions
Row Numbering Function
Aggregation Function
Scalar Functions
Sample Data
Scalar Functions, Definitions
ABS or ABSVAL
ACOS
ASCII
ASIN
ATAN
ATANH
ATAN2
BIGINT
BLOB
CEIL or CEILING
CHAR
CLOB
COALESCE
CONCAT
COSH
ENCRYPT
EVENT_MON_STATE
FLOAT
FLOOR
GENERATE_UNIQUE
GETHINT
GRAPHIC
HASHEDVALUE
HOUR
IDENTITY_VAL_LOCAL
INSERT
INT or INTEGER
JULIAN_DAY
LCASE or LOWER
LEFT
LENGTH
LN or LOG
LOCATE
LOG or LN
LOG10
LONG_VARCHAR
LONG_VARGRAPHIC
LOWER
LTRIM
MICROSECOND
MIDNIGHT_SECONDS
MINUTE
MONTH
MONTHNAME
MQ Series Functions
MULTIPLY_ALT
NULLIF
PARTITION
POSSTR
POWER
QUARTER
RADIANS
RAISE_ERROR
RAND
REAL
REC2XML
REPEAT
REPLACE
RIGHT
ROUND
RTRIM
SECOND
SIGN
SINH
SMALLINT
SNAPSHOT Functions
SOUNDEX
SPACE
SQLCACHE_SNAPSHOT
SQRT
SUBSTR
TABLE
TABLE_NAME
TABLE_SCHEMA
TANH
TIME
TIMESTAMP
TIMESTAMP_FORMAT
TIMESTAMP_ISO
TIMESTAMPDIFF
TO_CHAR
TO_DATE
TRANSLATE
TRUNC or TRUNCATE
TYPE_ID
TYPE_NAME
TYPE_SECHEMA
UCASE or UPPER
VALUE
VARCHAR
VARCHAR_FORMAT
VARGRAPHIC
VEBLOB_CP_LARGE
WEEK
WEEK_ISO
XML Functions
YEAR
"+" PLUS
"-" MINUS
"*" MULTIPLY
"/" DIVIDE
"||" CONCAT
Introduction to XML
XMLSERIALIZE
XML2CLOB
XMLAGG
XMLCONCAT
XMLELEMENT
XMLATTRIBUTES
XMLFOREST
XMLNAMESPACES
XML Function Examples
REC2XML Function
User Defined Functions
Sourced Functions
Description
Examples
Table Functions
Order By, Group By, and Having
Order By
Notes
Order by Examples
Group By and Having
Rules and Restrictions
GROUP BY Flavors
GROUP BY Sample Data
Simple GROUP BY Statements
GROUPING SETS Statement
ROLLUP Statement
CUBE Statement
Complex Grouping Sets - Done Easy
Group By and Order By
Group By in Join
COUNT and No Rows
Joins
Why Joins Matter
Sample Views
Join Syntax
ON vs. WHERE
Join Types
Inner Join
Left Outer Join
Right Outer Join
Full Outer Joins
Cartesian Product
Join Notes
Using the COALESCE Function
Listing non-matching rows only
Join in SELECT Phrase
Predicates and Joins, a Lesson
Sub-query Syntax
Correlated vs. Uncorrelated Sub-Queries
Multi-Field Sub-Queries
Nested Sub-Queries
Usage Examples
True if NONE Match
True if ANY Match
True if TEN Match
True if ALL match
Union, Intersect, and Except
Syntax Diagram
Usage Notes
Union & Union All
Intersect & Intersect All
Except & Except All
Unions and Views
Materialized Query Tables
Select Statement Restrictions
Refresh Deferred Tables
Refresh Immediate Tables
Usage Notes and Restrictions
Multi-table Materialized Query Tables
Indexes on Materialized Query Tables
Organizing by Dimensions
Using Staging Tables
Identity Columns and Sequences
Identity Columns
Altering Identity Column Options
Gaps in Identity Column Values
IDENTITY_VAL_LOCAL Function
Sequences
Getting the Sequence Value
Multi-table Usage
Counting Deletes
Identity Columns vs. Sequences - a Comparison
Roll Your Own
Support Multi-row Inserts
Temporary Tables
Temporary Tables - in Statement
Common Table Expression
Full-Select
Declared Global Temporary Tables
Recursive SQL
Use Recursion To
When (Not) to Use Recursion
How Recursion Works
List Dependents of AAA
Notes & Restrictions
Sample Table DDL & DML
Introductory Recursion
List all Children #1
List all Children #2
List Distinct Children
Show Item Level
Select Certain Levels
Select Explicit Level
Trace a Path - Use Multiple Recursions
Extraneous Warning Message
Stop When Loop Found
Keeping the Hierarchy Clean
Clean Hierarchies and Efficient Joins
Limited Update Solution
Full Update Solution
Retaining a Record
Schema Design
Recording Changes
Multiple Versions of the World
Fun with SQL
Creating Sample Data
Create a Row of Data
Create "n" Rows & Columns of Data
Linear Data Generation
Tabular Data Generation
Cosine vs. Degree - Table of Values
Make Reproducible Random Data
Make Random Data - Different Ranges
Make Random Data - Different Flavours
Make Random Data - Varying Distribution
Make Test Table & Data
Time-Series Processing
Find Overlapping Rows
Find Gaps in Time-Series
Show Each Day in Gap
Other Fun Things
Randomly Sample Data
Convert Character to Numeric
Convert Number to Character
Convert Timestamp to Numeric
Selective Column Output
Making Charts Using SQL
Multiple Counts in One Pass
Multiple Counts from the Same Row
Find Missing Rows in Series / Count all Values
Normalize Denormalized Data
Denormalize Normalized Data
Reversing Field Contents
Stripping Characters
Sort Character Field Contents
Query Runs for "n" Seconds
Calculating the Median
Quirks in SQL
Trouble with Timestamps
No Rows Match
Dumb Date Usage
Ambiguous Cursors
Floating Point Numbers
Legally Incorrect SQL
Appendix
DB2 Sample Tables
Class Schedule
Department
Employee
Employee Activity
Employee Photo
Employee Resume
In Tray
Organization
Project
Sales
Staff
Add Primary Keys
Book Binding
Index
0 of .
Results for:
No results containing your search query
P. 1
DB2V82 Cookbook

DB2V82 Cookbook

Ratings: (0)|Views: 3|Likes:
Published by xjonny

More info:

Published by: xjonny on Jul 17, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/17/2011

pdf

text

original

You're Reading a Free Preview
Pages 8 to 120 are not shown in this preview.
You're Reading a Free Preview
Pages 128 to 224 are not shown in this preview.
You're Reading a Free Preview
Pages 232 to 296 are not shown in this preview.
You're Reading a Free Preview
Pages 304 to 359 are not shown in this preview.
You're Reading a Free Preview
Pages 367 to 386 are not shown in this preview.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->