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, Sample Database Tables. This database can be created using the "First Steps" installation launchpad. You can also create the SAMPLE database from the command line. See the SQL Reference for further details.
Note that additional sample databases are included with DB2 Universal Database to demonstrate the Data Warehouse Center and OLAP Starter Kit functionality. The examples in this book use only the general SAMPLE database.
Depending on how your database has been set up, you may have 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: