ER diagrams: weak entities
简介 / Introduction
A weak entity is one that does not have a full primary key of its own and depends on a strong (owner) entity for its identification. Its primary key is composed of a partial key plus the foreign key referencing the owning entity. This article shows how to draw ER diagrams with weak entities in both PlantUML and Mermaid.
PlantUML 版
1 | @startuml |
Notes:
<<WEAK>>marks the weak entity;+prefix denotes the primary key attribute;||..o{shows a “one owns many” relationship, where Student is the strong entity and Transcript depends on it.
Mermaid 版
1 | erDiagram |
Notes: Mermaid’s ER diagrams do not have a <<WEAK>> annotation; weak entity semantics are expressed implicitly through the relationship. ||--o{ denotes a one-to-many “owns” relationship.
对比 / Side-by-side
| Feature | PlantUML | Mermaid |
|---|---|---|
| Weak entity marker | <<WEAK>> |
Not supported; implied by semantics |
| Primary key marker | + prefix |
PK suffix |
| Relationship arrow | ` | |
| Field separator | -- |
Auto-separated |
小结 / Wrap-up
PlantUML explicitly marks weak entities with <<WEAK>>, making the semantics clear. Mermaid expresses this implicitly via relationship arrows, offering simpler syntax but no dedicated weak-entity support. Choose based on your team’s tooling and documentation conventions.
- Title: ER diagrams: weak entities
- Author: puml.online
- Created at : 2026-09-16 09:00:00
- Updated at : 2026-09-29 01:06:38
- Link: https://puml.online/blog/er-diagram-weak-entity-en/
- License: This work is licensed under CC BY-NC-SA 4.0.