Diagramate

Library Management System ER Diagram Template

ER diagram with six entities (member, book, loan, category, publisher, librarian), the loan junction entity and primary and foreign keys. A common database coursework and capstone topic, exported as PNG, Word or PowerPoint for free.

borrows

is lent in

groups

publishes

processes

MEMBER

string

member_id

PK

string

name

string

member_type

int

loan_limit

LOAN

string

loan_id

PK

string

member_id

FK

string

book_id

FK

string

librarian_id

FK

date

borrowed_on

date

due_on

date

returned_on

BOOK

string

book_id

PK

string

isbn

string

title

string

author

string

category_id

FK

string

publisher_id

FK

boolean

available

CATEGORY

string

category_id

PK

string

name

PUBLISHER

string

publisher_id

PK

string

name

LIBRARIAN

string

librarian_id

PK

string

name

Previewed in the “Ink Teal” theme; you can switch themes in the editor
Open in the editorFree · No sign-up · No watermark

Edit the text, pick a theme, export Word / PowerPoint / PDF

When to use it

One of the most common database coursework and capstone topics. Members and books are linked through loans, and the loan also records the librarian who processed it: three foreign keys in one table, a good example for teaching foreign keys.

Making it yours

  • Add RESERVATION or FINE entities with their own field blocks and lines such as MEMBER ||--o{ RESERVATION.
  • Replace the boolean available with copies and copies_available if the library holds several copies of a title.
  • Use your real column names in place of the ones here.

Mermaid code

erDiagram
    MEMBER ||--o{ LOAN : borrows
    BOOK ||--o{ LOAN : "is lent in"
    CATEGORY ||--o{ BOOK : groups
    PUBLISHER ||--o{ BOOK : publishes
    LIBRARIAN ||--o{ LOAN : processes
    MEMBER {
        string member_id PK
        string name
        string member_type
        int loan_limit
    }
    BOOK {
        string book_id PK
        string isbn
        string title
        string author
        string category_id FK
        string publisher_id FK
        boolean available
    }
    LOAN {
        string loan_id PK
        string member_id FK
        string book_id FK
        string librarian_id FK
        date borrowed_on
        date due_on
        date returned_on
    }
    CATEGORY {
        string category_id PK
        string name
    }
    PUBLISHER {
        string publisher_id PK
        string name
    }
    LIBRARIAN {
        string librarian_id PK
        string name
    }

Ask an AI for one with this structure

Send the prompt below to ChatGPT or Claude, then paste the whole reply into the editor; the code inside is detected automatically.

Draw a library management system ER diagram in Mermaid erDiagram syntax with entities MEMBER, BOOK, LOAN, CATEGORY, PUBLISHER and LIBRARIAN. A member borrows many loans, a book is lent in many loans, a category groups many books, a publisher publishes many books and a librarian processes many loans. List the main fields of each entity with PK and FK markers. Output only the mermaid code block.

FAQ

Why is LOAN a separate entity?

Members and books are many-to-many (a member borrows many books, a book is borrowed by many members), which needs a junction table; a loan also has its own attributes (borrowed and due dates), so it is naturally an entity.

ER diagram or class diagram?

An ER diagram describes database tables and their relationships; a class diagram describes the classes, attributes and methods in the code. There is also a library system class diagram in the template library; reports often include both.

Can the export go straight into a coursework report?

Yes. Export the PNG at 3x or as a Word document; the Word file includes the Mermaid code after the figure for quick changes when the marker asks for them.

More in this category

All templates

Updated 2026-09-05