INFORMIX
Informix Guide to SQL: Tutorial
Chapter 8: Building Your Data Model
Home Contents Index Master Index New Book

Diagramming Your Data Objects

At this point, you have already discovered and understood the entities and relationships in your database. That is the most important part of the relational database design process. Once you have determined the entities and relationships, you might find it helpful to have a method for displaying your thought process during database design.

Most data-modeling methods provide some form of graphically displaying your entities and relationships. Informix uses the E-R diagram approach originally developed by C. R. Bachman. E-R diagrams serve the following purposes:

Several different styles of documenting E-R diagrams exist. If you already have a style that you prefer, use it. Figure 8-12 shows a sample E-R diagram.

Figure 8-12
Symbols of an Entity-Relationship Diagram

Entities are represented by a box. Relationships are represented by a line that connects the entities. In addition, you use several graphical items to display the following features of relationships, as Figure 8-13 shows:

Figure 8-13
The Parts of a Relationship in an Entity-Relationship Diagram

Reading Entity-Relationship Diagrams

You read the diagrams first from left to right and then from right to left. In the case of the name-address relationship in Figure 8-14, you read the relationships as follows. Names can be associated with zero or exactly one address; addresses can be associated with zero, one, or many names.

Figure 8-14
Reading an Entity-Relationship Diagram

The Telephone-Directory Example

Figure 8-15 shows the telephone-directory example and includes the entities, relationships, and attributes. This diagram includes the relationships that were established with the matrix. After you study the diagram symbols, compare the E-R diagram in Figure 8-15 with the matrix in Figure 8-10. Verify for yourself that the relationships are the same in both figures.

A matrix such as Figure 8-10 is a useful tool when you are first designing your model because, in filling it out, you are forced to think of every possible relationship. However, the same relationships appear in a diagram such as Figure 8-15, and this type of diagram might be easier to read when you are reviewing an existing model.

Figure 8-15
Preliminary Entity-Relationship Diagram of the Telephone-Directory Example

After the Diagram Is Complete

The rest of the chapter describes the following tasks:

Chapter 9, "Implementing Your Data Model," shows you how to create a database from the E-R data model.




Informix Guide to SQL: Tutorial, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.