Mermaid ER Diagram Tutorial

Design database schemas visually with Mermaid ER diagrams. Learn entity declarations, attribute types, relationships, and cardinality notation.

Entities represent database tables. Declare an entity with its name followed by curly braces containing attributes. Each attribute has a type and a name. The erDiagram keyword starts the diagram.

erDiagram
    USER {
        int id
        string email
        string name
        timestamp created_at
    }

Live Editor

Mermaid Code
Loading Monaco Editor...