What Is an ER Diagram? How to Build One and Express Relationships
Published:
Last Updated:
Category: Campaign Management, Marketing DX
Published:
Last Updated:
Category: Campaign Management, Marketing DX

Authors: Shusaku Yosa
An ER diagram turns up in a system specification and the symbols on the ends of the lines mean nothing to you. Or you sit down to draw one and cannot tell how much detail to include. ER diagrams show the structure of data, and if you only need to read them, there is not much to learn. This article covers the building blocks, how relationships are expressed, and a method for building one.
An ER diagram (entity relationship diagram) represents the data a system handles as groupings and the relationships between them.
On an e-commerce site, for instance, there are groupings such as customer, order, and product, with relationships like "a customer has multiple orders" and "an order contains multiple products." Drawing that is what produces an ER diagram.
There are three main uses.
From a client's position, the second comes up most. You do not need to draw one yourself, but being able to read what you are shown and judge whether the understanding matches reality removes a great deal of rework.
An ER diagram is made of these three.
A grouping of data. Customer, order, product, employee — whatever you are managing. Drawn as a rectangle with the name inside.
Convention is to use a singular noun. Not "customers" but "customer"; not "order list" but "order." Think of each rectangle as describing the shape of a single record.
The fields an entity holds. For a customer: name, email address, phone number, registration date. Listed inside the rectangle beneath the entity name.
The field that uniquely identifies a single record is called the primary key. Customer ID or order number typically fills this role, marked on the diagram with an underline or the label PK.
The connection between entities. Rectangles are joined by a line, and symbols on the line show what kind of connection it is. This is the most important part of an ER diagram, and also the hardest to read.
Relationships divide into three by the counts on each side.
One record on each side corresponds to exactly one on the other. Employee and employee detail, or user and user settings, are typical examples.
It does not appear often, though. If the relationship is one-to-one, the two can usually be merged into a single table. Where they are kept apart, there should be a reason: too many fields, very different access patterns, or a need to separate permissions.
The most common relationship. One record on one side corresponds to several on the other.
"One customer has many orders, but each order belongs to exactly one customer." That is the archetype. Department and employee, or category and product, take the same shape.
Both sides correspond to several. "An order contains multiple products, and the same product appears in multiple orders."
The key point here is that a many-to-many relationship cannot become a table as it stands. You place another table in between and break it into one-to-many relationships: order — order line — product. That middle table is called a junction table or associative entity.
In practice, that middle table holds fields of its own. For an order line: quantity, and the price at the time of ordering. Treat it as something that carries meaningful data, not merely as a connector.
The correspondence of counts is called cardinality. Several notations exist, but the most widely used today shows it through the shape at the end of the line.
The symbols carry two pieces of information at once. The outer one, nearer the entity, gives the maximum; the inner one gives the minimum.
Read them in combination. Circle and stroke means "zero or one"; stroke and foot means "one or more"; circle and foot means "zero or more."
Rather than memorising symbols, convert them into sentences. Read along the line from one side to the other: "for one customer, zero or more orders." Then do the same in reverse: "for one order, exactly one customer."
Reading in both directions matters. Look at one side only and you will miss mismatches in the constraints.
Collect the nouns that come up in the work: customer, order, product, stock, owner. At this stage do not think about fields or relationships; a list is enough.
Before drawing anything, write the relationships out in words. "A customer has zero or more orders." "An order contains one or more products."
This is where the awkward cases surface. How do you handle an order from someone who has not registered an account? What happens to past orders for a discontinued product? Discovering these after drawing the diagram means significant rework.
Find the many-to-many relationships in what you wrote and introduce a middle entity for each. Thinking about what fields that middle table needs at this point reduces the rework later.
Only now do you draw the rectangles and lines. Once finished, test it against concrete data. Can this diagram express "a repeat customer placed five orders and cancelled one of them"?
If you find a case it cannot express, an entity or a field is missing.
When a vendor presents an ER diagram, you do not need to judge its technical soundness. What you should check is only whether your own business can be expressed.
The fourth is the expensive one to change later. Check that the design does not let a change to a product's price also change the amounts on past orders.
It depends on the purpose. For aligning understanding with a client, entities and relationships alone are enough. Listing every field raises the reader's load and pulls attention away from the relationships, which are the point. For implementation, produce a separate detailed version including types and constraints.
Split the diagram by business area: everything around orders, everything around stock, everything around membership. Entities that sit on a boundary can appear in both diagrams.
At the exploratory stage, pen and paper or sticky notes are enough. When you need a clean version, either a drawing tool or a tool that generates the diagram from text will do. The latter has the advantage of making change history easier to keep.
Set a rule that the diagram is revised whenever the table structure changes. An ER diagram out of step with reality is more dangerous than none at all. If you cannot maintain it, the most you should do is note the date it was made and treat it as a reference document.
An ER diagram shows only the structure of the data and its constraints. It cannot show when, by whom, or through what procedure that data gets entered. When aligning understanding with a client, viewing it alongside a diagram of the business process closes most of the gaps.
And once the system design is settled, the work moves to managing the project that implements it. Xtrategy manages campaign schedules alongside budget and KPIs on a single screen.
The point of an ER diagram is not to memorise symbols; it is to align understanding about how data is handled. Start by writing your own operation out in the form "X has how many Y."
What separates free and paid flowchart tools: simultaneous editing, diagram limits, export formats, version history, and...

The bar chart schedule explained against network and S-curve formats. Covers its advantage of being readable without exp...

Effort, man-hour, and man-day sit at different levels: effort is the concept, person-hours and person-days are the units...