Tables in this data model
- AUTHOR — 2 columns
- BOOK — 5 columns
- BOOK_AUTHOR — 2 columns
- PUBLISHER — 2 columns
- BRANCH — 2 columns
- COPY — 4 columns
- MEMBER — 3 columns
- LOAN — 5 columns
- HOLD — 4 columns
- FINE — 3 columns
How to use this ER diagram template
- Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the Mermaid source below and paste it in through ☰ → Import diagram (see the Mermaid editor); it imports as an editable diagram.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
Mermaid source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
erDiagram
AUTHOR ||--o{ BOOK_AUTHOR : writes
BOOK ||--o{ BOOK_AUTHOR : "written by"
PUBLISHER ||--o{ BOOK : publishes
BOOK ||--o{ COPY : "has copies"
BRANCH ||--o{ COPY : holds
MEMBER ||--o{ LOAN : borrows
COPY ||--o{ LOAN : "lent in"
MEMBER ||--o{ HOLD : places
BOOK ||--o{ HOLD : "held for"
LOAN ||--o| FINE : "may incur"
AUTHOR {
int author_id PK
string name
}
BOOK {
int book_id PK
int publisher_id FK
string isbn
string title
int year
}
BOOK_AUTHOR {
int book_id FK
int author_id FK
}
PUBLISHER {
int publisher_id PK
string name
}
BRANCH {
int branch_id PK
string name
}
COPY {
int copy_id PK
int book_id FK
int branch_id FK
string barcode
}
MEMBER {
int member_id PK
string name
date expires_on
}
LOAN {
int loan_id PK
int copy_id FK
int member_id FK
date due_on
date returned_on
}
HOLD {
int hold_id PK
int book_id FK
int member_id FK
date placed_on
}
FINE {
int fine_id PK
int loan_id FK
decimal amount
}
Related: Database schema diagram tool · Mermaid editor · All database & er models templates · All 521 templates