Verhoef Training Europe.

11B Kingsmead Square, Bath, BA1 2AB, UK
Phone:+44 (0)1753 852 233 Fax: +44 (0)1753 840 190



Structured Query Language




AUDIENCE:   Anyone who will be using SQL to extract data from DB2, SQL/DS, or other relational database management system.

PREREQUISITES:   The participants need no prior knowledge of the SQL language.

DURATION:   3 days. Hands on.

OBJECTIVES:   This course will provide students with SQL skills needed to build simple or complex interactive queries against data which is stored in DB2 (or similar) databases. The course includes an introduction to the structure and function of the DB2 product, and a comprehensive examination of the SQL language, including a progressive series of hands-on workshops to provide the student with experience in using the language. After taking this course the students should be able to utilise application programs to embed SQL statements within batch or on-line programs using DB2, SQL/DS, or similar SQL-based database management systems.

COURSE CONTENT:  

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS
The origin and history of IBMs relational products
Terminology pertinent to relational environments
Overview of DB2 system components
How data is physically stored in a relational DBMS
The logical organization of the database
How the system retrieves data from the database
Data relationships
SQL syntax rules
Using SPUFI (or QMF, ISPF) to build and execute interactive SQL queries

USING SQL FOR DATA DEFINITION
Understanding and using SQL data types
The use and implications of NULL values
Creating databases, tables, and other objects
Deleting databases, tables, and other objects
Understanding indexes
When and how to use an index
Advantages and disadvantages of index usage
Primary and foreign keys
Referential integrity
The optimizer, indexes, and the EXPLAIN statement

USING SQL FOR BASIC DATA RETRIEVAL
Syntax of SELECT statements
Tailoring a Select List to choose specific columns
Building expressions
Using the WHERE clause to choose specific rows
How to eliminate duplicate data
Coping with NULL values during data retrieval
Using DISTINCT, ANY, and ALL
Rules for logical comparison of data
Boolean comparison, using NOT, AND, and OR
Rules for arithmetic comparison of data
Using IN and NOT IN to build include lists
Using BETWEEN and NOT BETWEEN to define ranges
Pattern-matching and building search arguments, using LIKE, NOT LIKE, and wildcard values
Sorting output, using the ORDER BY clause
The EXISTS and NOT EXISTS predicates

USING SQL FOR ADVANCED DATA RETRIEVAL
Aggregate (Built-In) Functions, including AVG, MIN, MAX, COUNT (*), COUNT (DISTINCT), and SUM
Scalar Functions, including
Conversion between different data types
Date and time functions
Character string concatenation
GROUP BY and HAVING clauses
UNION and UNION ALL keywords
Joining tables
How to specify join criteria
Uses and rules for Sub-queries
Uses and rules for Views

USING SQL FOR DATA MODIFICATION
The INSERT statement, including examination of statement parameters and referential integrity implications.
The UPDATE statement, including examination of statement parameters and referential integrity implications.
The DELETE statement, including examination of statement parameters and referential integrity implications.
The COMMIT statement and database recovery.  

© 2007 Verhoef Training