IBM Books

Administration Getting Started


Overview of Basic Database Objects

This section provides an overview of the key database objects that are displayed in the Control Center and that you need to understand to perform the tasks in this book. In this book you will create a:

The following objects also are displayed in the Control Center and are described in other documentation that is shipped with the DB2 product (that is, they are not described in this book):

See the Road Map to DB2 Programming for an overview of triggers, UDTs, UDFs, and packages. See the Administration Guide for an overview of aliases. See the Replication Guide and Reference for an overview of replication objects. See the Quick Beginnings book for your platform and the Administration Guide for an overview of users and groups.

Tables

A relational database presents data as a collection of tables. A table consists of data logically arranged in columns and rows. The data in the table is logically related, and relationships can be defined between tables. Data can be viewed and manipulated based on mathematical principles and operations called relations. Table data is accessed via SQL, a standardized language for defining and manipulating data in a relational database.

Views

A view is an efficient way of representing data without needing to maintain it. A view is not an actual table and requires no permanent storage. A "virtual table" is created and used.

A view can include all or some of the columns or rows contained in the tables on which it is defined. For example, you can join a department table and an employee table in a view so that you can list all employees in a particular department.

Figure 8 shows the relationship among tables and views.

Figure 8. Relationship Among Tables and Views


* Figure SQLK0TVW not displayed.

Indexes

An index is a set of keys, each pointing to rows in a table. For example, table A in Figure 9 has an index based on the employee numbers in the table. This key value provides a pointer to the rows in the table: employee number 19 points to employee KMP. An index allows more efficient access to rows in a table by creating a direct path to the data through these pointers.

The SQL optimizer automatically chooses the most efficient way to access data in tables. The optimizer takes indexes into consideration when determining the fastest access path to data. See the Administration Guide for more information.

Unique indexes can be created to ensure uniqueness of the index key. An index key is a column or an ordered collection of columns on which an index is defined. Using a unique index will ensure that the value of each index key in the indexed column or columns is unique. "Step 3. Enforcing Business Rules for Data" describes keys and indexes in more detail.

Figure 9 shows the relationship between an index and a table.

Figure 9. Relationship Between an Index and a Table


* Figure SQLK0OBJ not displayed.

System Catalog Tables

Each database includes a set of system catalog tables, which describe the logical and physical structure of the data. DB2 creates and maintains an extensive set of system catalog tables for each database. These tables contain information about the definitions of the database objects such as user tables, views, and indexes, as well as security information about the authority that users have for these objects. They are created when the database is created, and are updated in the course of normal operation. You cannot explicitly create or drop them, but you can query and view their contents using the catalog views. For more information, see the Administration Guide and the SQL Reference.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]