Diagram data objects

Now you know and understand the entities and relationships in your database, which is the most important part of the relational-database design process. After you determine the entities and relationships, a method that displays your thought process during database design might be helpful.

Most data-modeling methods provide some way to graphically display the entities and relationships. HCL® OneDB® documentation uses the E-R diagram approach that C. R. Bachman originally developed. E-R diagrams serve the following purposes. They:
  • Model the informational requirements of an organization
  • Identify entities and their relationships
  • Provide a starting point for data definition (data-flow diagrams)
  • Provide an excellent source of documentation for application developers and both database and system administrators
  • Create a logical design of the database that can be translated into a physical schema
Several different styles of E-R diagrams exist. If you already have a style that you prefer, use it. Symbols of an Entity-Relationship diagram shows a sample E-R diagram.
Figure 1: Symbols of an Entity-Relationship diagram

A one-to-one relationship between name and address is shown and the parts of the diagram are labeled. The name and address entities are both shown as rectangles. The name of each entity is above the rectangle that represents it. The two rectangles are joined by a single solid line. The line represents the relationship between the two entities.
In an E-R diagram, a box represents an entity. A line represents the relationships that connect the entities. In addition, The parts of a relationship in an Entity-Relationship diagram shows how you use graphical items to display the following features of relationships:
  • A circle across a relationship link indicates optionality in the relationship (zero instances can occur).
  • A small bar across a relationship link indicates that exactly one instance of the entity is associated with another entity (consider the bar to be a 1).
  • The crow's-feet represent many in the relationship.
    Figure 2: The parts of a relationship in an Entity-Relationship diagram

    This figure shows the relationship between two unnamed entities. A "many" relationship is represented with two extra lines to connect the rectangle to the relationship line. The two lines start on either side of the relationship line and meet at the same point on the relationship line. The point at which they meet is near the rectangle representing the entity to which the "many" part of the relationship applies. This forms what is sometimes called a "crows foot." An "exactly one" relationship is shown with a short line across, and perpendicular to, the relationship line. This line is close to the rectangle representing the entity to which the "exactly one" part of the relationship applies. A circle that interrupts the relationship line near an entity indicates that the entity is optional.