ER Diagram for a Library Management System (Visio Example, Crow's Foot)
The library system is the classic ER diagram exercise. Draw Member, Book, Loan, Author and BookAuthor in Visio with crow's foot notation, and see how the two many-to-many relationships are fixed with junction entities.
Step by step
- Library ER diagram. A library system is the classic ER diagram exam question. Members borrow books, and books have authors. Let's draw it in Visio with crow's foot notation, and handle the one trap hiding inside it.
- Crow's Foot stencil. I'm using the Crow's Foot Database Notation stencil.
- Member. Start with member. Member ID is the primary key, then a name and an email.
- Book. Then book, on the far side. Book ID, a title and the year it came out.
- Loan. Here's the trap. A member borrows many books, and a book is borrowed many times. That's many to many, so put a loan entity in the middle. It holds both keys. Connect member to loan. One member has zero or many loans. A new member has none yet. And book to loan. One book has zero or many loans over its life.
- Author. Now the authors. Author ID, a name and a country.
- BookAuthor. A book can have several authors, and an author writes many books. Many to many again. Add a book author entity under book, holding both keys. Connect book down to it. Every book has one or many author rows. And author across to it. Every author has one or many book rows.
- Done. Click away to see the whole model. Five entities, four relationships.
- The rule. So, the trap is many to many. Members and books, then books and authors. Each time, add a junction entity that holds both keys. Do that, and the library model is done.