> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Entity Relationship Diagrams

### What are Entity Relationship Diagrams?

Mermaid's Entity Relationship Diagrams (ERDs) help you visualize database structures and relationships. For analytics engineers, they're essential for documenting data models, table relationships, and database schemas. ERDs show how different entities (tables) in your database relate to each other, including their attributes and the nature of their relationships.

***

### Creating Your First ERD

1. **Launch DinoAI:** From Code IDE, access [DinoAI](/products/dino-ai/index) to start creating diagrams.
2. **Use a Simple Prompt:** Tell DinoAI what kind of ERD you want to create. For example:

```text theme={"system"}
- "Create a mermaid  ERD diagram showing the relationships between my customer, order, and product tables"

- "Generate a mermaid ERD for my e-commerce data model with proper cardinality notation"

- "Build a mermaid ERD diagram for my dbt models showing table relationships and key columns"
```

3. **Get Your Diagram:** DinoAI will generate a complete `.mmd` file with proper Mermaid syntax.
4. **Preview Your Work:** Click the eye icon (👁️) to preview your diagram in real-time as you edit.
5. **Iterate and Refine:** Modify the generated `.mmd` file directly, or ask DinoAI to make specific changes.

#### Example

```mermaid theme={"system"}
---
title: Order example
---
erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
```

<Frame>
  <img src="https://mintcdn.com/paradime-docs/KJcB9NhKTmxLMoZP/images/image-1-1-1-1-1-2-1.png?fit=max&auto=format&n=KJcB9NhKTmxLMoZP&q=85&s=b435db966eb4ff231e9dc121d29ce780" alt="" width="399" height="533" data-path="images/image-1-1-1-1-1-2-1.png" />
</Frame>

<Info>
  **Reusable ERD prompts for you and your team**

  You can create custom, standardized [.dinoprompts](/products/dino-ai/copilot/dino-prompts) for Mermaid's ERDiagrams that ensure consistency across your data team. See [step-by-step guide.](/integrations/mermaid-js/index#creating-mermaid-diagrams-with-.dinoprompts)
</Info>

***

### Diagram Syntax Guide

#### Basic Entity Definition

```mermaid theme={"system"}
erDiagram
    FACT_TABLE {
        string order_id PK
        timestamp created_at
        decimal amount
    }
```

#### Cardinality Notation

Show relationships between entities using crow's foot notation:

* `||--||` : Exactly one to exactly one
* `||--o{` : One to many (zero or more)
* `||--|{` : One to many (one or more)
* `}o--o{` : Many to many

#### Relationship Types

* Solid lines (--): Identifying relationship
* Dotted lines (..): Non-identifying relationship

***

<Check>
  **Best Practices**

  1. Use clear, descriptive entity names
  2. Show only relevant attributes
  3. Include key relationships
  4. Use consistent naming conventions
  5. Document primary and foreign keys
  6. Group related entities together
</Check>

<Info>
  **Additional Resources**

  For more syntax options and advanced features, visit the [official Mermaid documentation](https://mermaid.js.org/syntax/entityRelationshipDiagram.html)
</Info>


## Related topics

- [Accelerating Data Governance](/guides/paradime-101/getting-started-with-the-paradime-ide/dinoai-accelerating-your-analytics-engineering-workflow/accelerating-data-governance.md)
- [Mermaid](/integrations/mermaid-js/index.md)
- [Requirement Diagrams](/integrations/mermaid-js/requirement-diagrams.md)
- [Sequence Diagrams](/integrations/mermaid-js/sequence-diagrams.md)
- [Class Diagrams](/integrations/mermaid-js/class-diagrams.md)
