Attaching Relationships between Entities
Relationships in an ER diagram can be defined as logical connections between two entities. You saw an example of a relationship earlier in this chapter in the How is an entity represented? section, but here, you will learn all about the different types of relationships between entities that are supported by Mermaid. You will learn how to define them and what they look like when rendered.
In Mermaid, the syntax of adding a relationship between two entities can be achieved by placing a special line with symbols on it (relationship) between the two entity name identifiers. This relationship can have different arrowheads to represent different types of relationships. The syntax looks like this:
entityId
relationentityI
d : labelText
Please note that you need all the parts of this syntax (or statement). In Mermaid, the relation
part is broken down into three segments:
- Beginning Arrowhead: Represents the cardinality of the first entity...