Skip to content

Entity Relationship Diagrams

Entity Relationship diagrams model database schemas and the cardinality between tables.

erDiagram
  CUSTOMER ||--o{ ORDER : "places"
  ORDER ||--|{ LINE-ITEM : "contains"
  CUSTOMER }|..|{ DELIVERY-ADDRESS : "uses"
erDiagram
  CUSTOMER {
    string id PK
    string name
    string email
  }
  ORDER {
    string id PK
    date created
    string customer_id FK
  }
  LINE-ITEM {
    string id PK
    int quantity
    string order_id FK
  }
  CUSTOMER ||--o{ ORDER : "places"
  ORDER ||--|{ LINE-ITEM : "contains"