The entity-relationship model was created to help describe relationships among data in a graphical format. You will hear the term "entity-relationship diagram" (ERD) or "entity-relationship model" (ERM) quite often to describe the entities and the relationships that they model.
The model represents entities or tables in an ERD with a rectangle, which is also known as an "entity box". The name of the entity or table is written in the center of the rectangle. The entity name is generally written in capital letters and in the singular form. An entity can then consist of a set of attributes that has characteristics of the entity. For example, in our Postgres database, the ARTIST entity contains the attributes of artist_id and the artist_name.
Next, we have relationships that describe the associations between the entities. The data relationships are either one-to-many, many-to-many, or one-to-one. These relationships show the connectivity between those entities. Generally, the name of the relationship is a verb that explains what the relationship is. In our example, an ARTIST can RECORD many ALBUMs.
There are three common notations that are used to represent relationships in an ERD: Chen notation, Crow’s Foot, and UML class diagram notation.
Chen notation is based on Peter Chen’s approach. For a relationship, each entity (represented by the rectangle) is connected by a diamond that contains the relationship name within it. On the relationship line, there is a representation of the connectivity: either a one-to-one relationship, a one-to-many relationship, or a many-to-many relationship. Attributes of an entity or table would be listed in ovals connected to the rectangle.
Chen notation for a one-to-one relationship between table1 and table2 would look like the following:
Chen notation for a one-to-many relationship between table1 and table2 would look like the following:
Chen notation for a many-to-many relationship between table1 and table2 would look like the following:
Crow’s Foot notation (below) is slightly different. Notice that the relationship name is placed above the relationship line, instead of in a diamond. The rectangles still contain the table name at the top, but then would list the attributes below the table name. The relationship line shows a short bisecting line segment if it is on the “one” side and a crow’s foot (two short bisecting lines) if it is on the "many" side.
Crow’s Foot notation for a one-to-one relationship between table1 and table2 would look like the following:
Crow’s Foot notation for a one-to-many relationship between table1 and table2 would look like the following:
Crow’s Foot notation for a many-to-many relationship between table1 and table2 would look like the following:
A class diagram (below) uses UML notation, which is similar to Crow’s Foot notation. Notice that the class/entity name is still at the top the rectangle, with attributes below it (and then methods/functionality below that). The connectivity is defined along the relationship line with symbols on each side, like 1..1 for one, and 1..* for many.
UML class diagram notation for a one-to-one relationship between table1 and table2 would look like the following:
UML class diagram notation for a one-to-many relationship between table1 and table2 would look like the following:
UML class diagram notation for a many-to-many relationship between table1 and table2 would look like the following:
Source: Authored by Vincent Tran