Communicating data with Entity Relationship Diagrams
Entity Relationship Diagrams (ERDs) are commonly used in communicating current or prospective database structures.
Using an ERD, you can show some of the tables in a relational database and how those tables relate to each other. This can help orient developers joining a project or find gaps in the systems you’re designing.
Let’s build a simple ERD showing how tables for football players, clubs, and matches might relate.
We’ll start with another Mermaid code cell:
erDiagram Clubs ||--|{ Players : "Currently in" Players }|--o{ Matches : "Plays in" Matches }|--|| Clubs : "Home Club" Matches }|--|| Clubs : "Visiting Club"
The format of each line in our diagram starts with the table on the left, has a connector, then the table on the right, and then must have a colon...