ERD Diagrams
Create Entity-Relationship Diagrams (ERDs) to model database structures and data relationships.
What is an ERD?
An Entity-Relationship Diagram visualizes:
- Entities: Database tables or objects
- Attributes: Properties of entities
- Relationships: How entities connect to each other
- Cardinality: The nature of relationships (one-to-one, one-to-many, etc.)
Creating an ERD
Adding Entities
- Choose the Table tool in the toolbar and click on the canvas to create a table for each entity
- Use the first row as the entity name and the following rows for attributes
See Tables for editing rows, columns, and cell text.
Each entity typically contains:
- Entity name (header)
- Primary key field(s)
- Other attributes
Adding Relationships
- Select the Connector Tool
- Draw a line between related entities
- Set appropriate arrowheads for cardinality
Crow's Foot Notation
Crow's foot notation is the most common ERD style. It uses symbols at connector ends to show cardinality.
Cardinality Symbols
| Symbol | Meaning |
|---|---|
| ` | ` (single line) |
○ (circle) | Zero (optional) |
< or > (crow's foot) | Many |
Common Relationships
| Notation | Start | End | Meaning |
|---|---|---|---|
| One-to-One | ` | ` | ` |
| One-to-Many | ` | ` | < |
| Many-to-Many | < | > | Multiple relate to multiple |
| Zero-or-One | `○ | ` | ` |
| Zero-or-Many | ○< | ` | ` |
Applying Crow's Foot Arrowheads
- Select a connector between entities
- In the Inspector's Style tab, go to the Connector section
- Pick Start Arrowhead and End Arrowhead from the Built-in Arrowheads list. The ERD arrowheads are:
| Arrowhead | Typical meaning |
|---|---|
| Bar Bar | Exactly one (‖) |
| Bar Ball | Zero or one (○|) |
| Crows Feet | Many |
| Crow Bar | One or many (|<) |
| Crow Ball | Zero or many (○<) |
Crow Bar Segment and Crow Ball Circle are alternative drawings of the one-or-many and zero-or-many ends.
You can also right-click the end of a connector to choose its arrowhead.
Example ERD Workflow
Step 1: Identify Entities
For an e-commerce database:
- Customer
- Order
- Product
- OrderItem
Step 2: Define Attributes
Customer
- customer_id (PK)
- name
- phone
Order
- order_id (PK)
- customer_id (FK)
- order_date
- total
Step 3: Draw Entities
- Create a table with the Table tool for each entity
- Add entity names as headers
- List attributes inside each table
- Mark primary keys (PK) and foreign keys (FK)
Step 4: Add Relationships
- Draw connector from Customer to Order
- Set "one" end at Customer (|)
- Set "many" end at Order (<)
- This shows: one customer has many orders
Step 5: Label Relationships
Add text labels to connectors:
- "places" (Customer → Order)
- "contains" (Order → OrderItem)
- "is product in" (Product → OrderItem)
ERD Best Practices
Layout
- Keep related entities close together
- Use consistent entity sizing
- Align entities in a grid pattern
- Minimize crossing connectors
Naming
- Use singular nouns for entities (Customer, not Customers)
- Use consistent naming conventions (camelCase, snake_case)
- Label relationships with verbs
Documentation
- Include primary keys for all entities
- Show foreign keys clearly
- Consider adding data types
- Note any constraints
Tips
- Start from text: Paste a Mermaid
erDiagramwith Edit → Insert Mermaid (PRO) to get a first draft, then refine it — see Mermaid Support - Use auto-layout: Helps organize complex diagrams
- Group related entities: Creates logical sections
- Export for documentation: Include in technical specs and wikis
- Version control: Save iterations as your database evolves