What you will learn
 

After completing this course, the student should be able to:

  • Explain DB2 concepts, terminology and components
  • Discuss the Primary Key (PK), Unique Key (UK) and Foreign Key (FK) concept
  • SELECT rows of data from DB2 tables
  • Use QMF and/or SPUFI  to "run" SQL statements
  • Use the WHERE clause to SELECT specific rows of a DB2 table
  • Build queries using the ORDER BY, GROUP BY, HAVING clauses
  • Use the CASE expressions and several SCALAR / COLUMN FUNCTIONS
  • Access multiple tables JOIN, UNION, sub-queries, nested table expressions
  • CREATE Tables, Indexes, Views
  • "Change" tables using the INSERT, UPDATE, DELETE statements
  • Describe the security provided by the GRANT and REVOKE
  • Discuss the design considerations of REFERENTIAL INTEGRITY
  • Perform DCLGENs to build table definitions and I/O areas
  • Modify a "shell" program to select a single row, multiple rows, and change rows
  • Discuss the importance of the SQLCODE and how to test for it
  • Discuss overall DB2 PERFORMANCE considerations
  • Run the EXPLAIN PLAN or VISUAL EXPLAIN and analyze results 
Audience
 

Experienced Data Processing personnel who need use SQL to design and develop programs to access DB2 data.

Prerequisites
 

At least six months of TSO/ISPF and COBOL programming experience is recommended.  No previous database experience is needed.

Duration
  Five Days.

Outline for DB2 for z/OS, SQL and Application Programming Training

DAY 1

 I. Introduction to DB2

     Course Introduction

 1. DB2 - Concepts, and Terminology

II. Structured Query Language (SQL)

 2. SQL 1 - The SELECT Statement

Hands-on Lab - SELECT

 3. Database 2 Interactive / SPUFI

 4. SQL 2 – SQL Functions

Hands-on Lab - SELECT / Special Features

 5. SQL 3 - ORDER BY, GROUP BY, HAVING

Hands-on Lab - ORDER BY, GROUP BY, HAVING

DAY 2

II. Structured Query Language (SQL) (Continued)

 6. SQL 4 - Join, Sub-select, UNION

Hands-on Lab - Join, Sub-select, UNION

 7. SQL 5 - Data Definition Language

 8. SQL 6 - INSERT, UPDATE, DELETE

Hands-on Lab - Creating DB2 Components & - Insert, Update, Delete

 9. SQL 8 – Other SQL Topics

DAY 3

III. DB2 Application Programming

10. SQL Programming I - Overview

11. SQL Programming II - Data and Procedure Division Changes

Hands-on Lab - SELECT a single row into a program

12. SQL Programming III - SELECTing Multiple Rows

Hands-on Lab - SELECT more than one row - the CURSOR

DAY 4

III. DB2 Application Programming (Continued)

13. Concurrency Control - Locking

14. SQL Programming IV - INSERT, UPDATE, DELETE

Hands-on Lab - updating and Referential Integrity

DAY 5

III. DB2 Application Programming (Continued)

Hands-on Lab - Updating and Referential Integrity

IV. Additional Topics

15. SQL Programming V - Other Programming Considerations

16. DB2 Performance Introduction - EXPLAIN PLAN or VISUAL EXPLAIN

Hands-on Lab - Analyze SQL statements