Skip to content

entity-relationship diagram (ERD)

An entity-relationship diagram (ERD) is a visual model of a database’s structure that shows the kinds of things a system stores data about, the details recorded for each, and how those things relate to one another.

The diagram has three building blocks. An entity is a distinct kind of thing, such as a customer or an order, and usually becomes a table once the design turns into a SQL schema. Attributes are the properties an entity records, such as a name or a date. A relationship is a named association between entities, such as a customer placing an order.

Each relationship also carries a cardinality, which states how many instances on one side can connect to instances on the other. The basic cases are one-to-one, one-to-many, and many-to-many. In a library model, a member borrows many books, and a book passes through many members’ hands over time. A relational schema resolves that many-to-many link with a junction table, here a loan table holding one row per borrowing:

Member and Book each link one to many to a Loan entity, whose member_id and book_id foreign keys resolve the many-to-many link.
A Junction Table Resolving a Many-to-Many Link

Several notations draw the same model in different ways:

  • Chen notation: Shows entities as rectangles, relationships as diamonds, and attributes as ovals.
  • Crow’s foot notation: Draws relationships as plain lines whose ends mark cardinality, with a three-pronged fork standing for “many”.
  • UML class diagrams: Reuse the class boxes of the Unified Modeling Language, list attributes inside each box, and write multiplicities such as 1 and 0..* on the lines.

Peter Chen introduced the entity-relationship model in a 1976 paper as a way to describe data independently of how a database stores it. Gordon Everest proposed the crow’s foot symbol the same year. ERDs remain a standard step in database design, and an object-relational mapper expresses the same entities and relationships as classes.

Data Management With Python, SQLite, and SQLAlchemy

Tutorial

Data Management With Python, SQLite, and SQLAlchemy

Store and retrieve data with Python, SQLite, and SQLAlchemy. You'll compare flat files with SQL and work with your data as Python objects.

intermediate databases web-dev

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Martin Breuss • Updated Nov. 10, 2026