Creating and Loading the Sample Tables
Many of the examples in this book, particularly the reporting examples, have been developed against a sample time-tracking database. It’s a fairly simplistic database, containing only three tables, but it’s enough to illustrate everything I talk about in this book. You may or may not wish to create this database for yourself. Creating the database will allow you to try all the examples in this book exactly as they are shown. If you choose not to create and load the sample database, at least familiarize yourself with the data model. Also glance at the sample data itself, which is reproduced later in this section. If you have looked at the model and at the data, you shouldn’t have any trouble following and understanding the examples in this book.
The Data Model
Figure 1.2 shows an Entity Relationship Diagram, or ERD, for the sample database.

Figure 1-2. The sample database
As you can see from the ERD, there are only three entities: EMPLOYEE, PROJECT, and PROJECT_HOURS. Table 1.2 gives a brief description of each entity.
Table 1-2. Entity Descriptions
|
Entity Name |
Description |
|---|---|
|
EMPLOYEE |
Contains one record for each employee. This record contains the employee’s name, hire date, termination date, and billing rate. The primary key is an arbitrary employee ID number. The termination date for current employees is set to NULL. |
|
PROJECT |
Contains one ... |