Skip to content
Entity Relationship Diagram

An entity relationship diagram (ERD) maps out the data model of a system. Entities are the things being stored — users, books, reading lists. Attributes describe the data each entity holds. The lines between entities show how they are related, with symbols at each end describing how many of each can be involved.

ERDs are used in database design, but they are a useful thinking tool any time you want to understand how different types of information connect — whether you are building a website, planning a spreadsheet, or designing an app.

erDiagram
    USER {
        int id PK
        string name
        string email
    }
    BOOK {
        int id PK
        string title
        string author
    }
    READING_LIST {
        int user_id FK
        int book_id FK
        date added_on
    }

    USER ||--o{ READING_LIST : has
    BOOK ||--o{ READING_LIST : appears_in

The crow's-foot notation at each end of the lines describes cardinality: the forked end means 'one or many'; the single line means 'exactly one'; the circle means 'zero or one'.

Syntax
MARKDOWN
```mermaid
erDiagram
    USER {
        int id PK
        string name
        string email
    }
    BOOK {
        int id PK
        string title
        string author
    }
    READING_LIST {
        int user_id FK
        int book_id FK
        date added_on
    }

    USER ||--o{ READING_LIST : has
    BOOK ||--o{ READING_LIST : appears_in
```

For more entity relationship diagram syntax see the entity relationship diagram documentation at mermaid.js.org

© 2026 Docizr. All rights reserved.