home   sql examples   next page    

SQL examples for DB2 and UDB databases:

This is my quick and easy guide to using SQL - the Structured Query Language for IBM DB2 and UDB databases.

This guide assumes no previous experience of writing SQL Queries and is suitable for the novice or infrequent SQL user.

PageDB2 SQL Topic
1Simple Select statements with "Where" and "Order by"
2Simple Select statements using "AND" and "OR"
3Simple Select statements using "NOT"
4Simple Select statements using Logical Operators
5Eliminating duplicate rows with "Distinct"
6Column arithmetic and deriving new data columns
7What are Null values? Handling Null values
8Using DB2 Built In Functions "Count", "Sum", "Avg", "Max", "Min"
9Selecting data with "Like", "In" and "Between"
10Selecting data with Date and Time values
11How to summarise data with "Group By" and "Having"
12Using Joins to select data from more than one table
13What are "Outer Joins"? "Left", "Right" and "Full" Outer Joins
14Care with Outer Joins and the "Where" clause
15Using Union to select data from more than one table
16Using the "Case" statement
17Nested SQL queries - "Subqueries"
18Relating the data in queries and subqueries - "Correlated subqueries"
19Correlated subqueries Using "Exists" and "Not Exists
20Inserting data
21Deleting data
22Updating data

    home   sql examples   next page