This section describes how to connect to a database, and retrieve data using SQL statements.
In the examples, we present the statement to be entered followed in most cases by the results that will be displayed when that statement is issued against the sample database. Note that although we show the statements in uppercase, you can enter them in any mixture of upper and lowercase characters (except where they are enclosed in either single quotes (') or quotes ('') ).
The SAMPLE database, included with DB2 Universal Database, consists of several tables, as listed in Appendix A. Create the database.
Depending on how your database has been set up, it may be necessary to qualify the table names used, by prefixing them with the schema name and a period. For examples in this book, the default schema is assumed to be USERID. So you could refer to the table ORG as USERID.ORG. Ask your administrator whether or not this is necessary.
This chapter covers: