What Is ER Diagram for Library Management System?

Learn via video course
FREE
View all courses
DBMS Course - Master the Fundamentals and Advanced Concepts
DBMS Course - Master the Fundamentals and Advanced Concepts
by Srikanth Varma
1000
5
Start Learning
DBMS Course - Master the Fundamentals and Advanced Concepts
DBMS Course - Master the Fundamentals and Advanced Concepts
by Srikanth Varma
1000
5
Start Learning
Topics Covered

ER diagram stands for Entity Relationship diagram and is used to analyze the structure of a database. It helps to establish a relationship between entities and their attributes.

ER Diagram Example for Library Management Systems

To get a better overview of how exactly a library management system works, let us explore an example.

ER diagram of a Library Management System contains various entities and their attributes, which explains the overall structure and functioning of a library and ultimately helps in designing its database. A Library Management System database keeps track of the following considerations –

  • Both the Admin and users can log in to access the permitted functionalities in a Library database.
  • The Admin maintains the book record by updating the availability status of books and can add or delete book records.
  • Every Book has its own Barcode No, title, Price, availability status, author, and other details.
  • Every user is registered with their library_id, name (first name, last name), Mobile No, email, address, and the number of books issued. The Admin keeps track of all the users.
  • Every Admin is registered with their admin_id, name (first name, last name), Mobile No, email, and address.
  • Users can issue and return books corresponding to which, they will have an issue date and return date respectively. A user can get the books issued from the Admin after successful login.

library management system database

Library Management System Database Design

library management system database design

The diagram shown above is a database design for the library management system. In this, every entity is shown along with its attributes and relationships with other entities. We have also considered the library database having both CDs and books, each having its own key attributes like ISBN or ISSN.

Example- Comprehensive ER Diagram for Library Management System

comprehensive-er-diagram-library-management-system

The above diagram is a more complex example of an ER diagram for the Library Management system. As we can see, multiple new entities are now included in this ER diagram. One more exciting thing about this ER diagram is that one entity is linked to more than one entity.

Various symbols and notations used in the above diagrams will be discussed in detail in the next sections.

What Are the Problems with Building a Library Management System?

ER diagram for a Library Management System is used to show how a library management system would work, but while creating it we might encounter some of the following problems:

  1. A single user can issue multiple books from the library database, meaning a one-to-many relationship must be followed between the user and book entities.
  2. A user might become a subscriber once they have paid some fees, so there should be a provision in the ER diagram for the up-gradation of user entities.
  3. A scalable library requires staff to maintain the book catalog with its Barcode No, Book title, Price, genre, edition, and details regarding the author.
  4. In a library, multiple users enroll themselves, which will require a unique user_id to identify them uniquely.
  5. When issuing books, there needs to be an issue date and due date set in place to return that Book, which requires another addition in the ER Diagram.
  • Entities and their Attributes Now we will see the possible entities and their attributes in a Library Management System.
    • User:
      • Library ID – a unique ID to log in for each user
      • Name – Name of the user
      • Mobile no. – phone number of the user
      • Address – Address of the user
      • Branch – course name, e.g. MSc, BTech, etc
      • No. of books issued
    • Admin:
      • Admin ID – a unique ID for the administrator
      • Name – full name of the Admin
      • Phone no. – phone number of the Admin
    • Login:
      • Login ID – Library ID in case of user and Admin ID in case of admin
      • Password – a security code for logging into the library portal
    • Book:
      • Barcode No. – a unique barcode number for each Book
      • Title – Title of the Book
      • Author – Name of the author
      • Price – the Price of the Book
      • Status – if a book is available or not
    • Book Record:
      • Add a record – for adding new information
      • Update record – for updating existing information
      • Delete record – for deleting information
      • Total books available – it shows the number of books available at that time
  • Relationships between Entities After the creation of entities, the next important part is to establish a relationship between these entities. There can be multiple types of relationship cardinalities. Cardinality in DBMS can be defined as a relationship between the data in two different tables by highlighting how many times a specific entity occurs compared to another. For example, the database of an Library Management System can show that a User issues multiple books from the Library. relationship cardinality These arrow representations are important to remember as they help us create the required type of relation between the entities. While designing a library management system, these relationships play a vital role in knowing their placement in the database.

How to Create an ER Diagram for a Library Management System?

Let us now explore the step-by-step procedure for creating an ER Diagram of the Library Management system.

  • Step 1: The first step is to identify the entities in the system. An entity is a real-world object that has multiple instances of being existent. Entities in an ER diagram are represented by a Rectangular Box. The entities in a library Management system are:

    • User
    • Book
    • Admin
    • Login
    • Book Record

    Below is the representation of an Entity in an ER Diagram entity er diagram

  • Step 2: Now, we have to select attributes for these entities. An attribute can be defined as a characteristic that stores values that are used to describe the entity. For example, the attributes of a User entity are Library ID, Name, Address, etc. The attributes are needed to differentiate between entities., such as multiple books, users, etc. Attributes in an ER Diagram are represented by an oval shape. Below is the representation of an Attribute in an ER Diagram attribute er diagram

  • Step 3: Third step is to identify the key attributes of every entity. A key attribute is used to uniquely identify an entity set. These are underlined attributes represented in an oval shape. The key attributes for entities in a library management system are:

    • Admin: Admin ID
    • User: Library ID
    • Book: Barcode No

    Below is the representation of a Key Attribute in an ER Diagram keyattribute

  • Step 4: The fourth step is to establish a relationship between entities. This is important to analyze the database clearly and make a better library management system. Relationships in an ER Diagram are represented by a diamond box.

    • A single user can issue multiple books if they want. This kind of relationship is known as a one-to-many relationship.
    • A single admin can issue books to multiple users if required. Making this a one-to-many relationship.
    • Multiple book records can be handled by a single admin, thus creating a many-to-one relationship.
    • The login authentication system allows login to multiple admins and users. This relationship is again one-to-many.

    Below is the representation of a Relationship in an ER Diagram relation

  • Step 5: Final step is to combine all the above steps, join the entities and their attributes and form an ER diagram.

Learn More

  • To learn in-depth about database management systems you can visit DBMS Tutorial.
  • To understand What is an Entity, visit Entity in DBMS

Conclusion

  • An Entity Relationship diagram is used to analyze the structure of a database and helps to establish relationships between entities and their attributes.
  • Relationships between entities are necessary to analyze the database clearly and make a better library management system.
  • An ER diagram of the Library Management System contains various entities and their attributes that explain the functioning of a library in brief.