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

Table Of Contents

Book Editions
Quick Find
Index of Concepts
Introduction to SQL
Syntax Diagram Conventions
SQL Components
DB2 Objects
DB2 Data Types
DECFLOAT Arithmetic
Date/Time Arithmetic
DB2 Special Registers
Distinct Types
Fullselect, Subselect, & Common Table Expression
SELECT Statement
FETCH FIRST Clause
Correlation Name
Renaming Fields
Working with Nulls
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
Processing Sequence
CAST Expression
VALUES Statement
CASE Expression
CASE Syntax Styles
Sample SQL
Miscellaneous SQL Statements
Cursor
CURSOR
Select Into
Prepare
Describe
Execute
Execute Immediate
Set Variable
Set DB2 Control Structures
Unit-of-Work Processing
Commit
Savepoint
Release Savepoint
Rollback
ROLLBACK
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
Column Functions
Column Functions, Definitions
ARRAY_AGG
CORRELATION
COUNT
COUNT_BIG
COVARIANCE
GROUPING
Regression Functions
STDDEV
VAR or VARIANCE
OLAP Functions
The Bad Old Days
Concepts
PARTITION Expression
Window Definition
ROWS vs. RANGE
ORDER BY Expression
Nulls Processing
RANK and DENSE_RANK
ROW_NUMBER
FIRST_VALUE and LAST_VALUE
LAG and LEAD
Aggregation
Scalar Functions
Sample Data
Scalar Functions, Definitions
ABS or ABSVAL
ACOS
ASCII
ASIN
ATAN
ATAN2
ATANH
BIGINT
BIT Functions
BLOB
CARDINALITY
CEIL or CEILING
CHAR
CHARACTER_LENGTH
CLOB
COALESCE
COLLATION_KEY_BIT
COMPARE_DECFLOAT
CONCAT
COSH
DATAPARTITIONNUM
DATE
DAYNAME
DAYOFWEEK
DAYOFWEEK_ISO
DAYOFYEAR
DAYS
DBCLOB
DBPARTITIONNUM
DBPARTITIONNUM (
DECFLOAT
DEC or DECIMAL
DECODE
DECRYPT_BIN and DECRYPT_CHAR
DEGREES
DEREF
DIFFERENCE
DIGITS
DOUBLE or DOUBLE_PRECISION
ENCRYPT
EVENT_MON_STATE
FLOAT
FLOOR
GENERATE_UNIQUE
GETHINT
GRAPHIC
GREATEST
HASHEDVALUE
HOUR
IDENTITY_VAL_LOCAL
INSERT
INT or INTEGER
JULIAN_DAY
LCASE or LOWER
LEAST
LEFT
LENGTH
LN or LOG
LOCATE
LOG or LN
LOG10
LONG_VARCHAR
LONG_VARGRAPHIC
LOWER
LTRIM
MAX_CARDINALITY
MICROSECOND
MIDNIGHT_SECONDS
MINUTE
MONTH
MONTHNAME
MULTIPLY_ALT
NORMALIZE_DECFLOAT
NULLIF
OCTET_LENGTH
OVERLAY
PARTITION
POSITION
POSSTR
POWER
QUANTIZE
QUARTER
RADIANS
RAISE_ERROR
RAND
REAL
REPEAT
REPLACE
RID_BIT
RIGHT
ROUND
RTRIM
SECLABEL Functions
SECOND
SIGN
SINH
SMALLINT
SNAPSHOT Functions
SOUNDEX
SPACE
SQRT
STRIP
SUBSTR
TABLE
TABLE_NAME
TABLE_SCHEMA
TANH
TIME
TIMESTAMP
TIMESTAMP_FORMAT
TIMESTAMP_ISO
TIMESTAMPDIFF
TO_CHAR
TO_DATE
TOTALORDER
TRANSLATE
TRIM
TRUNC or TRUNCATE
TYPE_ID
TYPE_NAME
TYPE_SCHEMA
UCASE or UPPER
VALUE
VARCHAR
VARCHAR_BIT_FORMAT
VARCHAR_FORMAT
VARCHAR_FORMAT_BIT
VARGRAPHIC
WEEK
WEEK_ISO
YEAR
"+" PLUS
"-" MINUS
"*" MULTIPLY
"/" DIVIDE
"||" CONCAT
User Defined Functions
Sourced Functions
Description
Examples
Check Data Value Type
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
Query Processing Sequence
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
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, & Minus
Unions and Views
Materialized Query Tables
Syntax Options
Select Statement
Optimizer Options
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
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
Logical Hierarchy Flavours
Divergent Hierarchy
Convergent Hierarchy
Recursive Hierarchy
Balanced & Unbalanced Hierarchies
Data & Pointer Hierarchies
Halting Recursive Processing
Stop After "n" Levels
Stop When Loop Found
Keeping the Hierarchy Clean
Clean Hierarchies and Efficient Joins
Limited Update Solution
Full Update Solution
Triggers
Trigger Syntax
Trigger Usage
Trigger Examples
Before Row Triggers - Set Values
Before Row Trigger - Signal Error
After Row Triggers - Record Data States
After Statement Triggers - Record Changes
Examples of Usage
Protecting Your Data
Sample Application
Enforcement Tools
Distinct Data Types
Customer-Balance Table
US-Sales Table
Conclusion
Retaining a Record
Schema Design
Recording Changes
Multiple Versions of the World
Using SQL to Make SQL
Export Command
SQL to Make SQL
Running SQL Within SQL
Generate SQL within SQL
Make Query Column-Independent
Business Uses
Meta Data Dictionaries
DB2 SQL Functions
Function and Stored Procedure Used
Different Data Types
Java Functions
Tabular Functions
Transpose Function
Update Real Data using Meta-Data
Fun with SQL
Creating Sample Data
Data Generation
Make Reproducible Random Data
Make Random Data - Different Ranges
Make Random Data - Varying Distribution
Make Random Data - Different Flavours
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
Find Missing Rows in Series / Count all Values
Multiple Counts from the Same Row
Normalize Denormalized Data
Denormalize Normalized Data
Transpose Numeric Data
Reversing Field Contents
Fibonacci Series
Business Day Calculation
Query Runs for "n" Seconds
Sort Character Field Contents
Calculating the Median
Converting HEX Data to Number
Quirks in SQL
Trouble with Timestamps
No Rows Match
Multiple User Interactions
What Time is It
Floating Point Numbers
Appendix
DB2 Sample Tables
CATALOG
CL_SCHED
CUSTOMER
DATA_FILE_NAMES
DEPARTMENT
EMPLOYEE
EMPMDC
EMPPROJACT
EMP_PHOTO
EMP_RESUME
IN_TRAY
INVENTORY
PRODUCT
PRODUCTSUPPLIER
PROJACT
PROJECT
PURCHASEORDER
SALES
STAFF
SUPPLIERS
Book Binding
Bibliography
IBM Sources
DB2 Manuals
Red Books
Online Tutorials
Other Sources
Books Published
Roger Sanders Books
DB2 Magazine
0 of .
Results for:
No results containing your search query
P. 1
DB2V95CK

DB2V95CK

Ratings: (0)|Views: 3,952|Likes:
Published by flaviojfranco264

More info:

Published by: flaviojfranco264 on Aug 01, 2010
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

10/25/2012

pdf

text

original

You're Reading a Free Preview
Pages 10 to 189 are not shown in this preview.
You're Reading a Free Preview
Pages 199 to 236 are not shown in this preview.
You're Reading a Free Preview
Pages 246 to 274 are not shown in this preview.
You're Reading a Free Preview
Pages 284 to 424 are not shown in this preview.
You're Reading a Free Preview
Pages 434 to 468 are not shown in this preview.

You're Reading a Free Preview

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