ER Diagrams That Stay Readable: Notation, Naming, and Layout

Capítulo 4

Estimated reading time: 9 minutes

+ Exercise

1) Consistent naming conventions (entities, attributes, relationships)

Readable ER diagrams start with naming that makes meaning obvious and prevents “same thing, different name” confusion. Your goal is that a reader can predict names without asking you, and can map diagram elements to business language used in requirements.

Entity (table) naming

  • Use singular nouns: Customer, Order, Product (not Customers).
  • Use consistent casing (pick one): PascalCase (SalesOrder) or snake_case (sales_order). Keep it consistent across the diagram.
  • Avoid abbreviations unless universally understood in your domain. Prefer Address over Addr.
  • Disambiguate similar concepts with qualifiers: BillingAddress vs. ShippingAddress, OrderLine vs. Order.

Attribute naming

  • Use clear, specific names: order_date is clearer than date.
  • Use a consistent pattern for keys: either id inside each entity (and rely on entity context), or entity_id everywhere. Example with entity_id: customer_id, order_id, product_id.
  • Foreign keys should match the referenced primary key name: if Customer has customer_id, then Order should also store customer_id (not cust_id).
  • Boolean attributes read like yes/no questions: is_active, is_paid.
  • Dates/times include granularity: placed_at (timestamp) vs. placed_on (date).

Relationship naming (when you label relationships)

In crow’s foot ERDs, relationships are often implied by lines and foreign keys, but labeling can help when meaning is not obvious.

  • Use verb phrases that read well: Customer places Order, Order contains OrderLine, OrderLine references Product.
  • Keep direction consistent: choose a “parent-to-child” reading style and stick with it.

A small naming standard you can copy

Entities: Singular nouns, PascalCase (Customer, SalesOrder, OrderLine, Product) Attributes: snake_case (customer_id, placed_at, unit_price) Primary key: {entity}_id Foreign key: {referenced_entity}_id Relationship labels (optional): verb phrase (places, contains, references)

2) Keys and relationship lines: choose one notation and apply it consistently

ERDs become hard to read when notation changes mid-diagram. Pick one notation (here: crow’s foot) and use it everywhere. The diagram should make these decisions visible: which attributes uniquely identify a row, and how many rows can relate across entities.

How to show keys

  • Primary key (PK): underline the attribute name or mark it with PK. Choose one style and keep it consistent.
  • Foreign key (FK): mark with FK or use a different visual style (e.g., italic). Again: one style only.
  • Composite keys: show all participating attributes as PK (e.g., PK (order_id, line_number)).

Crow’s foot relationship line basics (consistency rules)

  • One-to-many: a single line near the “one” side, crow’s foot near the “many” side.
  • Optional vs. mandatory: use the same symbols throughout (e.g., circle for optional, bar for mandatory) and don’t mix with other conventions.
  • Identify relationship type visually: if you use identifying vs. non-identifying relationships (solid vs. dashed), apply that rule everywhere or don’t use it at all.

Practical consistency checklist

  • All PKs are marked the same way.
  • All FKs are marked the same way.
  • All relationship ends use the same crow’s foot symbols for optional/mandatory.
  • No mixed casing or mixed pluralization in entity names.

3) Layout techniques for readability

Layout is not decoration; it is communication. A readable ERD makes the “core story” visible first, and details discoverable without hunting.

Group related entities

  • Cluster by workflow: place entities that participate in the same business process near each other (e.g., ordering flow: Customer → Order → OrderLine).
  • Separate reference/look-up entities: place stable reference entities (e.g., Product) slightly aside so they don’t dominate the main flow.

Emphasize core entities

  • Center the core: put the entity that connects most relationships near the center (often Order in commerce examples).
  • Use whitespace: leave space around the core cluster so relationship lines are easy to trace.

Avoid crossing lines

  • Reposition before rerouting: move boxes to eliminate crossings rather than bending lines excessively.
  • Prefer orthogonal connectors (right angles) if your tool supports it; they are easier to follow than diagonals.
  • Align entities in rows/columns so lines run mostly horizontal/vertical.

Reduce visual noise inside entity boxes

  • Show only key and decision-driving attributes on the main ERD (PKs, FKs, and a few critical attributes).
  • Defer long attribute lists to a data dictionary or a “detailed ERD” page.

Use consistent ordering of attributes

  • PK first, then FKs, then other attributes.
  • Group related attributes (e.g., money fields together: unit_price, line_total).

Step-by-step walkthrough: building a readable ER diagram from requirements

This walkthrough assumes earlier requirements describe a simple ordering system where the database must answer questions like: “Which orders did a customer place?”, “What products are in an order?”, and “What is the total for an order?”. The goal here is not to re-derive entities or cardinalities, but to turn those decisions into an ERD that stays readable.

Continue in our app.
  • Listen to the audio with the screen off.
  • Earn a certificate upon completion.
  • Over 5000 courses for you to explore!
Or continue reading below...
Download App

Download the app

Step 0: Set your diagram standards (before drawing anything)

Write your standards at the top of your notes so you don’t drift mid-way.

  • Entity names: PascalCase singular (Customer, Order, OrderLine, Product)
  • Attribute names: snake_case
  • PK naming: {entity}_id and marked with PK
  • FK naming: {referenced_entity}_id and marked with FK
  • Notation: crow’s foot; optionality shown consistently (circle = optional, bar = mandatory)

Checkpoint A (readability): Can another person predict how you’ll name the next entity and its key without asking you?

Step 1: Place the core entities first (layout-first approach)

Start by placing only the core boxes, no attributes yet. For an ordering flow, a common readable layout is left-to-right:

  • Customer on the left
  • Order in the center
  • OrderLine to the right of Order
  • Product further right or slightly above/right (reference entity)

This arrangement minimizes crossings because the relationships mostly flow in one direction.

Checkpoint B (questions alignment): Looking only at these boxes, can you point to where data would live to answer: “Which orders did a customer place?” and “What products are in an order?” If not, you may be missing a core entity or you placed reference entities in the wrong cluster.

Step 2: Add primary keys (make identity explicit)

Add only the PK attribute to each entity first. Keep PK at the top of each box.

Customer: PK customer_id Order:    PK order_id OrderLine:PK order_line_id  (or composite; see note below) Product:  PK product_id

Note: If your earlier design chose a composite key for OrderLine (e.g., PK (order_id, line_number)), show it explicitly and keep the formatting consistent.

Checkpoint C (questions alignment): For each question the database must answer, can you identify which entity’s PK would be used to locate the relevant rows? Example: to find an order’s lines, you should be able to start from Order.order_id.

Step 3: Draw relationship lines using crow’s foot (no extra attributes yet)

Now connect entities with relationship lines and cardinality/optionality markers, using your chosen crow’s foot symbols consistently.

  • Customer to Order: one customer to many orders (and decide whether an order must have a customer; typically yes).
  • Order to OrderLine: one order to many order lines (typically mandatory on the order line side).
  • Product to OrderLine: one product to many order lines (an order line references exactly one product).

At this stage, you should already see the story: Customer → Order → OrderLine → Product.

Checkpoint D (notation consistency): Are all “many” ends shown with the same crow’s foot symbol? Are optional relationships marked the same way everywhere? If you notice yourself “inventing” a new symbol, stop and standardize.

Step 4: Add foreign keys to reflect the relationships

Foreign keys make the relationships implementable and help readers understand join paths. Add FKs directly under PKs.

Customer (PK customer_id, ...) Order (PK order_id, FK customer_id, ...) OrderLine (PK order_line_id, FK order_id, FK product_id, ...) Product (PK product_id, ...)

Even if your ER tool draws relationships without showing FKs, including them in the entity boxes improves clarity for learners and implementers.

Checkpoint E (questions alignment): Trace the join path for each key question using only PK/FK fields: “Which products are in order 123?” should follow Order.order_idOrderLine.order_idOrderLine.product_idProduct.product_id. If you cannot trace it, a relationship or FK is missing or misnamed.

Step 5: Add only decision-driving non-key attributes

Now add a small set of attributes that matter for the questions and business rules. Avoid dumping every possible field; that belongs in a data dictionary.

  • Customer: full_name, email
  • Order: placed_at, status
  • OrderLine: quantity, unit_price
  • Product: product_name, list_price

Keep attribute ordering consistent: PK, then FKs, then other attributes.

Checkpoint F (signal vs. noise): If you removed one attribute from each entity, would the ERD still answer the core questions? If yes, consider removing it from the diagram and keeping it in documentation instead.

Step 6: Refine layout to eliminate crossings and highlight the core

With relationships and key fields visible, adjust placement:

  • Keep Order central with the most whitespace around it.
  • Place Customer left of Order and align vertically to keep the line straight.
  • Place OrderLine right of Order and align to reduce bends.
  • Place Product near OrderLine so the OrderLineProduct line is short and doesn’t cross the main flow.

If your tool supports it, use consistent connector routing (orthogonal) and consistent spacing between boxes.

Checkpoint G (readability test): Print or zoom out until entity names are barely readable. Can you still follow the main flow (Customer → Order → OrderLine → Product) without tracing with your finger? If not, reposition to reduce line length and crossings.

Step 7: Add relationship labels only where ambiguity remains

If a relationship’s meaning is obvious, you can omit labels. Add labels when the same pair of entities could be interpreted multiple ways.

  • Customer —places→ Order
  • Order —contains→ OrderLine
  • OrderLine —references→ Product

Checkpoint H (shared understanding): Ask: “Could a stakeholder misread this relationship?” If yes, label it. If no, keep the diagram cleaner.

Step 8: Final verification against the database questions (diagram as a communication tool)

Use the ERD to validate that it supports the questions the database must answer. For each question, do a quick “path check”:

  • Question: Which orders did a customer place? Path: Customer.customer_idOrder.customer_id
  • Question: What products are in an order? Path: Order.order_idOrderLine.order_idOrderLine.product_idProduct.product_id
  • Question: What is the total for an order? Path: Order.order_idOrderLine (use quantity and unit_price; whether you store totals or compute them is a design decision documented elsewhere, but the ERD should at least show where the inputs live)

If any question requires an unclear hop (e.g., “Where does that ID come from?”), the ERD is telling you either the naming is inconsistent, a key is missing, or the layout is hiding the core path.

Now answer the exercise about the content:

When adding foreign keys to an ER diagram for an ordering flow, which approach best supports readability and clear join paths?

You are right! Congratulations, now go to the next page

You missed! Try again.

Readability improves when FK names match the referenced PK and are placed consistently (PK first, then FKs). This makes join paths easy to trace and avoids “same thing, different name” confusion.

Next chapter

Primary Keys and Identifiers: Stable Uniqueness in a Schema

Arrow Right Icon
Free Ebook cover Database Design Basics: From Requirements to a Clean Schema
44%

Database Design Basics: From Requirements to a Clean Schema

New course

9 pages

Download the app to earn free Certification and listen to the courses in the background, even with the screen off.