DEV Community

Cover image for Entity Relationship Diagram[ERD]
AryaGG
AryaGG

Posted on

Entity Relationship Diagram[ERD]

  • Entity Relationship Diagram / Entity Relationship Models

  • Entity is a distinct object or thing in the real world that can be identified and stored in a database. It is the fundamental to database and represents main object.

Customer: In an online store, a customer is an entity. Attributes might include CustomerID, Name, Email, and Address.
Book: In a library system, a book is an entity. Attributes might include BookID, Title, Author, and ISBN.
Order: In an e-commerce platform, an order is an entity. Attributes might include OrderID, OrderDate, and TotalAmount.

  • ERD is a visual representation of the entities within the system and the relationships between those entities. Helps to organize and structure data effectively.

Image description

Why

  • They help in organizing data, identifying relationships between entities, and ensuring a clear, efficient database design.

  • This makes it easier to understand, communicate, and implement the database.

Symbols Used in ER Diagrams

Image description

Image description

Cardinality

  • It specifies the number of instances of one entity that can or must be associated with each instance of another entity. It helps define the nature of the relationships between entities in a database.

  • Image description

Keys

Image description

  • Specialization and generalization are two opposite processes in database design and entity-relationship modeling.

Image description

Image description

Limitations of ER diagrams and models

  • Limited Detail: Can't show complex relationships well.
  • Static: Doesn't capture changes over time.
  • Varied Notations: Different symbols can cause confusion.
  • No Logic: Doesn't show how data is used or manipulated.
  • Cluttered: Gets messy with large databases.

Top comments (0)