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.
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
availablewithcopiesandcopies_availableif 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
Course Enrolment System ER Diagram TemplateER diagram with five entities (student, course, enrolment, instructor, department), primary and foreign keys and one-to-many relationships. For database coursework and capstone projects; change the fields and export PNG, Word or PowerPoint for free.
E-commerce Database ER Diagram TemplateER diagram with seven entities (customer, address, order, order item, product, category, payment), one-to-many and one-to-one relationships and the main fields. For online shop projects and capstone database design; free PNG, Word and PowerPoint export.
Updated 2026-09-05