Entity Relationship Diagram

If you are familiar with a relational database structure, you know that the most fundamental component of a relational database is the table. Tables are used to organize and store information. A table is organized in columns and rows of data. Each row contains a set of facts, which is an instance of the table.

In a relational database, all data values must also be atomic, which means that each cell in the table can contain only a single fact. A relationship also exists between the tables in the database. Each relationship is represented in an RDBMS by sharing one or more columns in two tables.

Like the tables and columns that comprise a physical model of a relational database, an ERD (and all other logical data models) includes equivalent components. The components let you model the data structures of the business, rather than the database management system. The logical equivalent to a table is an entity, and the logical equivalent to a column is an attribute.

In an ERD, a box represents an entity, which contains the name of the entity. Entity names are always singular: CUSTOMER not CUSTOMERS, MOVIE not MOVIES, COUNTRY not COUNTRIES. By using singular nouns, you benefit from a consistent naming standard and facilitate reading the diagram as a set of declarative statements about entity instances.

The following illustration depicts a hypothetical video store. The video store must track its customers, movies that can be rented or purchased, and rental copies of movies in the store.

Entity Relationship Diagram example

In an ERD, a line drawn between the entities in the model represents a relationship. A relationship between two entities also implies that facts in one entity refer to, or are associated with, facts in another entity. In the preceding example, the video store must track information about CUSTOMERs and MOVIE RENTAL COPYs. The information in these two entities is related, and this relationship can be expressed in a statement: A CUSTOMER rents one or more MOVIE RENTAL COPYs.