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(notCustomers). - Use consistent casing (pick one):
PascalCase(SalesOrder) orsnake_case(sales_order). Keep it consistent across the diagram. - Avoid abbreviations unless universally understood in your domain. Prefer
AddressoverAddr. - Disambiguate similar concepts with qualifiers:
BillingAddressvs.ShippingAddress,OrderLinevs.Order.
Attribute naming
- Use clear, specific names:
order_dateis clearer thandate. - Use a consistent pattern for keys: either
idinside each entity (and rely on entity context), orentity_ideverywhere. Example withentity_id:customer_id,order_id,product_id. - Foreign keys should match the referenced primary key name: if
Customerhascustomer_id, thenOrdershould also storecustomer_id(notcust_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
FKor 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
Orderin 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.
- Listen to the audio with the screen off.
- Earn a certificate upon completion.
- Over 5000 courses for you to explore!
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}_idand marked withPK - FK naming:
{referenced_entity}_idand marked withFK - 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:
Customeron the leftOrderin the centerOrderLineto the right ofOrderProductfurther 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_idNote: 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.
CustomertoOrder: one customer to many orders (and decide whether an order must have a customer; typically yes).OrdertoOrderLine: one order to many order lines (typically mandatory on the order line side).ProducttoOrderLine: 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_id → OrderLine.order_id → OrderLine.product_id → Product.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,emailOrder:placed_at,statusOrderLine:quantity,unit_priceProduct: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
Ordercentral with the most whitespace around it. - Place
Customerleft ofOrderand align vertically to keep the line straight. - Place
OrderLineright ofOrderand align to reduce bends. - Place
ProductnearOrderLineso theOrderLine→Productline 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→OrderOrder—contains→OrderLineOrderLine—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_id→Order.customer_id - Question: What products are in an order? Path:
Order.order_id→OrderLine.order_id→OrderLine.product_id→Product.product_id - Question: What is the total for an order? Path:
Order.order_id→OrderLine(usequantityandunit_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.