DB2 for i sample tables

These sample tables are referred to and used in the SQL programming and the SQL reference topic collections.

Along with the tables are the SQL statements for creating the tables.

As a group, the tables include information that describes employees, departments, projects, and activities. This information forms a sample application that demonstrates some of the features of the IBM® DB2® Query Manager and SQL Development Kit for i licensed program. All examples assume that the tables are in a schema named CORPDATA (for corporate data).

A stored procedure is included as part of the system that contains the data definition language (DDL) statements to create all of these tables and the INSERT statements to populate them. The procedure creates the schema specified on the call to the procedure. Because this is an external stored procedure, it can be called from any SQL interface, including interactive SQL and System i® Navigator. To call the procedure where SAMPLE is the schema that you want to create, issue the following statement:
CALL QSYS.CREATE_SQL_SAMPLE ('SAMPLE')
The schema name must be specified in uppercase. The schema must not already exist.
Note: In these sample tables, a question mark (?) indicates a null value.