Chapter 7. Implementing your database design

Exam topics that this chapter covers

Accessing DB2 UDB data:

  • Ability to create basic DB2 UDB objects

Working with DB2 UDB objects:

  • Ability to demonstrate usage of DB2 UDB data types

  • Given a situation, ability to create a table

  • Knowledge to identify when referential constraints should be used

  • Knowledge to identify methods of data validation

  • Knowledge to identify characteristics of a table, view, or index


Earlier in this book, you read about different DB2 structures. In “Chapter 4. Designing objects and relationships,” you read about the task of building the logical and physical designs of your database. That task encompasses these key concepts:

  • A table is a physical representation of an entity.

  • A column is a physical representation of an entity's attribute.

  • A row is a physical representation of an instance of an entity.

  • A primary key is a unique identifier for an instance of an entity.

After building a logical design and physical design of your relational database and collecting the processing requirements, you can move to the implementation stage. In general, implementing your physical design involves defining the various objects and enforcing the constraints on the data relationships.

The objects in a relational database are organized into sets called schemas. A schema provides a logical classification of objects in the database. The schema name is used as the qualifier of SQL objects such as tables, views, indexes, and triggers.

This chapter explains the task of implementing your database design in a way that most new users will understand. When you actually perform the task, you might perform the steps in a different order.

You define, or create, objects by executing SQL statements. This chapter summarizes some of the naming conventions for the various objects that you cancreate. Also in this chapter, you will see examples of the basic SQL statements and keywords that you can use to create objects in a DB2 database. (This chapter does not document the complete SQL syntax.)

To illustrate how to create various objects, this chapter refers to the example tables, which you can see in “Appendix A. Example tables in this book.”

Tip: When you create DB2 objects (such as tables, databases, views, and indexes), you can precede the object name with a qualifier to distinguish it from objects that other people create. (For example, MYDB.TSPACE1 is a different table space than DSNDB04.TSPACE1.) When you use a qualifier, avoid using SYS as the first three characters. If you do not specify a qualifier, DB2 assigns a qualifier for the object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.184.135