ER Model Overview
ER Diagram Components
Read aloud is unavailable in this browser.
The Visual Language of Database Design
Every discipline has its visual notation—architects use floor plans, electrical engineers use circuit diagrams, and database designers use Entity-Relationship diagrams. These visual languages work because they compress complex information into standardized symbols that practitioners can instantly recognize and reason about.
An ER diagram consists of a finite set of components: entities, attributes, relationships, cardinalities, and constraints. Each has a precise visual representation and semantic meaning. Mastering these components means you can both read any ER diagram you encounter and create diagrams that clearly communicate your database designs.
This page is your comprehensive reference to ER diagram components. We'll examine each element in depth: what it means, how it's drawn, when to use it, and how different notation styles represent it.
By the end of this page, you will understand every component of ER diagrams—entities, attributes (simple, composite, derived, multivalued, key), relationships, cardinality ratios, and participation constraints. You'll be able to read diagrams in multiple notation styles and choose appropriate symbols for your own models.
Entities: The Foundation
An entity represents a distinguishable thing in the real world that the database will track. Entities can be concrete (Person, Product, Building) or abstract (Appointment, Transaction, Policy). The key criterion is that instances of the entity can be uniquely identified and independently exist.
| Notation Style | Regular Entity Symbol | Weak Entity Symbol | Notes |
|---|---|---|---|
| Chen notation | Rectangle | Double rectangle | Most explicit; weak entities visually distinct |
| Crow's foot (IE) | Rectangle | Rectangle (contextual) | Weak entities inferred from identifying relationships |
| IDEF1X | Square-cornered box | Rounded-corner box | Dependent entities have rounded corners |
| UML Class Diagrams | Class box with name compartment | Stereotype «weak» | Uses object-oriented class notation |
Regular entities vs. weak entities:
Regular (strong) entities have an attribute or combination of attributes that uniquely identifies each instance. A Customer entity might have CustomerID; each customer has a unique ID regardless of their relationships to other entities.
Weak entities cannot be uniquely identified by their own attributes alone. They depend on a related owner entity for identification. Consider:
- Dependent (as in insurance dependents): A dependent is identified by which Employee they depend on plus their name/relationship. Two employees might each have a dependent named 'Sarah' who is a 'spouse.'
- Room: A room is identified by its Building plus RoomNumber. Room 101 in Building A is different from Room 101 in Building B.
- OrderLine: An order line is identified by its Order plus a line number. Line 1 of Order #5000 is different from Line 1 of Order #5001.
Weak entities always have a total participation in an identifying relationship with their owner entity—they cannot exist without that relationship.
Ask: 'Can this entity be uniquely identified by its own attributes alone?' If the answer is no—if you need to know 'which Order' or 'which Building' to identify it—you likely have a weak entity. Weak entities are extremely common: line items, room numbers, transaction details, dependent persons.
Entity naming conventions:
Professional ER diagrams follow consistent naming rules:
- Use singular nouns: Customer, not Customers. Product, not Products. The entity represents the concept, not a collection.
- Use meaningful names: Customer is better than Cust or C1. Order is better than O.
- Avoid technical terms: User is often better than SecurityPrincipal or AuthenticationSubject in conceptual models.
- Use domain vocabulary: Match terminology that stakeholders use. If they say 'Client', don't call it 'Customer' unless you deliberately want to standardize.
- Capitalize consistently: Either TitleCase (Customer, OrderLineItem) or UPPERCASE (CUSTOMER, ORDER_LINE_ITEM), not mixed.
Attributes: Entity Properties
Attributes are properties that describe entities (or relationships). They represent the data values associated with each instance. A Customer entity might have attributes like Name, Email, PhoneNumber, and DateOfBirth.
Attributes come in several varieties, each with specific semantics and notation:
- •Simple (atomic) attributes: Cannot be divided further. Examples: Age, Price, EmployeeID. These represent single, indivisible values.
- •Composite attributes: Can be decomposed into smaller parts with independent meaning. Address comprises Street, City, State, PostalCode, Country. FullName comprises FirstName, MiddleName, LastName.
- •Single-valued attributes: Hold exactly one value per entity instance. Each Person has exactly one DateOfBirth; each Product has exactly one SKU.
- •Multivalued attributes: Can hold multiple values per entity instance. A Person may have multiple PhoneNumbers. A Book may have multiple Authors. A Job may require multiple Skills.
- •Derived attributes: Values calculated from other attributes rather than stored. Age is derived from DateOfBirth and current date. OrderTotal is derived from summing OrderLine amounts.
- •Key attributes: Uniquely identify entity instances. SSN for Person (in US contexts), ISBN for Book, StudentID for Student. May be single or composite.
- •NULL-able attributes: May have no value for some instances. MiddleName is optional for many people. SpouseSSN is NULL for unmarried employees.
| Attribute Type | Chen Notation Symbol | Description |
|---|---|---|
| Simple attribute | Oval connected to entity | Basic attribute, no special marking |
| Composite attribute | Oval with sub-ovals connected | Parent oval branches to component ovals |
| Multivalued attribute | Double oval | Double ellipse border indicates multiple values |
| Derived attribute | Dashed oval | Dashed border indicates computed value |
| Key attribute | Underlined name in oval | Underline distinguishes identifying attributes |
| Composite key | Multiple underlined ovals | Multiple attributes together form the key |
Composite vs. simple: when to decompose?
Should Address be one attribute or a composite of Street, City, State, PostalCode, Country? The answer depends on your query requirements:
- If you only display the full address, keep it simple
- If you filter by City or State, decompose it
- If you validate postal codes by country, decompose it
A general rule: decompose if components will be independently accessed, validated, or queried. Keep simple if always treated as a unit.
Multivalued attributes and normalization:
Multivalued attributes like PhoneNumbers are conceptually convenient but create implementation challenges. In relational design, they typically become:
- A separate table (PersonPhoneNumbers with PersonID and PhoneNumber columns)
- An array/JSON column (in databases that support them)
At the conceptual level, showing multivalued attributes is correct and informative. The implementation decision comes later.
Derived attributes in conceptual models:
Including derived attributes clarifies that these values exist in the domain, even though they're computed. Showing Age (derived from DateOfBirth) documents that age is a meaningful concept. The implementation—whether stored and maintained or computed on-demand—is a later decision.
In crow's foot and many modern notations, attributes are listed inside entity rectangles rather than as external ovals. Key attributes are marked with 'PK' (primary key). This notation is more compact but loses some semantic richness—composite and derived attributes may not be visually distinguished. Use the notation your tools and organization prefer, but understand the underlying concepts.
Relationships: Entity Connections
Relationships represent associations among entities. They capture how entities in a database connect to each other. Understanding relationships—their names, degrees, attributes, and constraints—is essential to building accurate ER models.
| Notation Style | Standard Symbol | Identifying Relationship | Notes |
|---|---|---|---|
| Chen notation | Diamond connected by lines | Double diamond | Relationship names written inside diamond |
| Crow's foot (IE) | Line between entities | Solid line to dependent | Cardinality shown at line ends |
| IDEF1X | Line between entities | Solid line vs dashed line | Different line styles indicate identifying vs non-identifying |
| UML | Association line | Composition diamond | Navigation arrows optional; multiplicities at ends |
Relationship degree (arity):
The degree of a relationship is the number of entity types participating:
- Unary (degree 1): One entity type relates to itself. Employee MANAGES Employee (manager-subordinate). Person IS_MARRIED_TO Person.
- Binary (degree 2): Two entity types participate. Customer PLACES Order. Student ENROLLS_IN Course. This is by far the most common degree.
- Ternary (degree 3): Three entity types participate. Supplier SUPPLIES Part to Project. Doctor PRESCRIBES Medicine to Patient.
- N-ary (degree n): More than three participants. Rare in practice; usually decomposed into binary relationships.
Binary relationships dominate in real models. Ternary relationships are occasionally necessary when the combination of three entities has meaning not captured by pairwise relationships. Higher-arity relationships are almost never used.
Relationship attributes:
Relationships can have their own attributes that don't logically belong to either participating entity:
- Enrollment (Student-Course): Grade, EnrollmentDate
- Employment (Employee-Company): StartDate, Position, Salary
- Prescription (Doctor-Medicine-Patient): Dosage, Frequency, Duration
In Chen notation, relationship attributes are ovals connected to the relationship diamond. In crow's foot notation, if the relationship has attributes, it often gets promoted to an associative entity (a rectangle connected by relationships to both participants).
Relationship names should read naturally as verb phrases between entity names. 'Customer PLACES Order' reads smoothly. 'Customer ORDER_RELATIONSHIP Order' does not. Some designers also add an inverse reading: 'Order IS_PLACED_BY Customer.' Choose names that domain experts would use when describing their business.
Identifying vs. non-identifying relationships:
An identifying relationship connects a weak entity to its owner. The weak entity's primary key includes the owner's key. In Chen notation, this is shown as a double diamond connected to a double rectangle.
- Building <==CONTAINS==> Room: Room is identified by BuildingID + RoomNumber
- Order <==HAS==> OrderLine: OrderLine is identified by OrderID + LineNumber
A non-identifying relationship connects entities that are independently identifiable. The foreign key is present but not part of the receiving entity's primary key.
- Customer -- PLACES --> Order: Order has its own OrderID; CustomerID is just a reference
This distinction is crucial for key design and cascade behavior in the physical model.
Cardinality Ratios: Quantity Constraints
Cardinality ratio (also called cardinality constraint or mapping cardinality) specifies the maximum number of entity instances that can participate in a relationship. It answers: 'For one instance of Entity A, how many instances of Entity B can be related?'
| Ratio | Meaning | Example | Implementation Note |
|---|---|---|---|
| 1:1 (One-to-One) | Each A relates to at most one B; each B relates to at most one A | Person HAS Passport; Employee HAS ParkingSpot | Foreign key can go on either side; often merged tables |
| 1:N (One-to-Many) | Each A can relate to many B; each B relates to at most one A | Department EMPLOYS Employees; Customer PLACES Orders | Foreign key on the 'many' side pointing to 'one' side |
| M:N (Many-to-Many) | Each A can relate to many B; each B can relate to many A | Student ENROLLS_IN Course; Author WRITES Book | Junction/bridge table required in relational design |
Cardinality notation styles:
Different ER notations represent cardinality differently:
Chen notation:
- Writes '1', 'N', or 'M' near the entity on connection lines
- Simple and explicit but less visually immediate
Crow's foot (Information Engineering):
- Uses visual symbols at line ends
- Single line (|): One
- Crow's foot (three lines spreading like bird's foot): Many
- Highly visual; cardinality visible at a glance
Min-max notation (ISO):
- Uses (min,max) pairs at each end
- (0,1) = zero or one
- (1,1) = exactly one
- (0,N) = zero to many
- (1,N) = one to many
- Most precise but most verbose
UML multiplicities:
- Uses notation like '1', '0..1', '', '1..', '0..*'
- Familiar to object-oriented developers
- '*' means unlimited (many)
- •| (single bar): Exactly one
- •O (circle): Zero (optional)
- •< (crow's foot): Many
- •|| (double bar): One and only one (mandatory)
- •O|: Zero or one
- •|<: One or many
- •O<: Zero or many
- •1 or (1,1): Exactly one
- •0..1 or (0,1): Zero or one
- •1..* or (1,N): One or more
- •***** or (0,N): Zero or more
- •0..5 or (0,5): Zero to five
- •2 or (2,2): Exactly two
- •1..3 or (1,3): One to three
Cardinality is always read FROM one entity TO another. In 'Department EMPLOYS Employee (1:N)', read: 'One Department employs Many Employees' AND 'One Employee is employed by One Department.' The ratio describes BOTH directions. Beginners often misread cardinality by only considering one direction.
Participation Constraints: Mandatory vs. Optional
While cardinality specifies the maximum number of relationships, participation constraints specify whether relationships are mandatory or optional. Participation answers: 'Must every instance of this entity participate in this relationship?'
| Type | Also Called | Meaning | Example |
|---|---|---|---|
| Total participation | Mandatory, Existence dependency | Every entity instance MUST participate in the relationship | Every OrderLine MUST belong to an Order; an OrderLine cannot exist without an Order |
| Partial participation | Optional | Entity instances MAY but don't have to participate | An Employee MAY manage other Employees; not every employee is a manager |
Notation for participation:
Chen notation:
- Double line: Total participation (mandatory)
- Single line: Partial participation (optional)
Crow's foot notation:
- Circle (O) at entity end: Optional (can be zero)
- Bar (|) at entity end: Mandatory (at least one)
Min-max notation:
- Minimum of 0: Partial participation
- Minimum of 1+: Total participation
Examples with participation:
-
Department EMPLOYS Employee
- Department side: Partial (a department might be newly created with no employees yet)
- Employee side: Total (every employee must belong to a department)
-
Order CONTAINS OrderLine
- Order side: Total (every order must have at least one line item)
- OrderLine side: Total (every line item belongs to exactly one order)
-
Customer PLACES Order
- Customer side: Partial (a customer might be registered but hasn't ordered yet)
- Order side: Total (every order must have a customer)
Participation constraints capture business rules. 'Every employee must be assigned to exactly one department' is a total participation rule. 'A department may have zero employees' (perhaps during reorganization) is a partial participation rule. Get these rules from domain experts, not from assumptions.
Combining cardinality and participation:
Full relationship semantics require both cardinality and participation. Consider Employee WORKS_FOR Department:
- Cardinality: 1:N (one department has many employees; one employee works for one department)
- Employee participation: Total (every employee must work for a department)
- Department participation: Partial (a department might exist with no employees)
This gives us:
- Employee (1,1) -- WORKS_FOR -- (0,N) Department
Read: 'Each Employee works for exactly one Department; each Department has zero to many Employees.'
Weak entity participation:
Weak entities always have total participation in their identifying relationship. An OrderLine cannot exist without an Order. A Room cannot exist without a Building. This is inherent to the concept of weak entities—they depend on their owner for existence and identification.
Special Relationship Types
Beyond basic binary relationships, ER modeling supports several special relationship patterns that capture more complex real-world semantics.
- •Recursive (self-referencing) relationships: An entity relates to itself. Employee MANAGES Employee creates a management hierarchy. Person IS_PARENT_OF Person models family trees. Course IS_PREREQUISITE_FOR Course captures academic dependencies.
- •Ternary relationships: Three entities participate simultaneously. Supplier SUPPLIES Part to Project—the relationship involves all three entities at once. Not decomposable into binaries if the combination has independent meaning.
- •Identifying relationships: Connect weak entities to their owners. The weak entity borrows part of its key from the owner. Shown as double diamonds in Chen notation.
- •Multiple relationships between same entities: Two entities may have more than one relationship. Employee WORKS_IN Department and Employee MANAGES Department are distinct relationships between the same entity types.
- •Supertype/subtype relationships: Generalization hierarchies where a supertype (Person) has specialized subtypes (Student, Employee). These are Enhanced ER (EER) concepts covered in depth in later modules.
Recursive relationship detail:
Recursive relationships require role names to clarify which role each entity instance plays:
- Employee MANAGES Employee
- Role 1: Manager (the employee doing the managing)
- Role 2: Subordinate (the employee being managed)
Without role names, the diagram is ambiguous. Role names are placed on the relationship lines near the entity.
Cardinality in recursive relationships:
- MANAGES: 1:N (one manager supervises many subordinates; each subordinate has at most one direct manager)
- IS_MARRIED_TO: 1:1 (one person is married to one person)
- IS_FRIEND_OF: M:N (a person has many friends; is a friend of many people)
Ternary relationship detail:
Ternary relationships capture situations where binary relationships lose information:
- Supplier S supplies Part P
- Part P is used in Project J
- These binaries don't tell us: Does Supplier S actually supply Part P to Project J?
The ternary SUPPLIES(Supplier, Part, Project) captures this three-way association directly. Cardinality in ternary relationships specifies: 'Given instances of two entities, how many of the third can relate?'
Use ternary relationships only when the three-way combination has meaning that pair-wise relationships cannot capture. If binary relationships suffice (possibly with a junction entity), prefer them—ternary relationships are harder to read and implement. But don't force binaries if they lose information.
ER Notation Comparison
As introduced in the history page, multiple ER notations exist. Here's a practical comparison to help you work with whichever notation your organization or tools use:
| Element | Chen | Crow's Foot | IDEF1X | UML |
|---|---|---|---|---|
| Entity | Rectangle | Rectangle | Rectangle | Class box |
| Weak Entity | Double rectangle | Rectangle + context | Rounded rectangle | «weak» stereotype |
| Attribute | Oval connected | Listed inside entity | Listed inside entity | Listed in class |
| Key attribute | Underlined in oval | PK marker | Marked specifically | «PK» or {id} |
| Relationship | Diamond | Line only | Line only | Association line |
| Cardinality | 1/N labels | Crow's feet symbols | Cardinality markers | Multiplicities (1..*) |
| Participation | Single/double line | O/| at ends | Solid/dashed line | 0..* vs 1..* |
| Relationship attribute | Oval on diamond | Associative entity | Associative entity | Association class |
- •Most explicit semantics
- •Relationship diamonds force naming
- •Attribute types visually distinct
- •Excellent for teaching concepts
- •No ambiguity in interpretation
- •More compact diagrams
- •Cardinality visible at a glance
- •Industry standard in CASE tools
- •Familiar to practitioners
- •Scales to large models
Practical guidance:
-
Learn Chen notation first: Its explicitness helps build conceptual understanding. Once you truly understand what each element means, translating to other notations is mechanical.
-
Use crow's foot in practice: Industry tools predominantly support it. Your colleagues and clients will likely expect it.
-
Be notation-fluent: A professional database designer should read any common notation. Don't be the person who can't understand a diagram because it uses unfamiliar symbols.
-
Be consistent within a project: Don't mix notations in the same diagram or document set. Choose one and stick with it.
-
Include a legend: For any diagram that will be shared, include a notation key/legend. Never assume readers know your notation style.
Your ER diagramming tool often determines notation. ERwin uses crow's foot. Lucidchart supports multiple notations. MySQL Workbench uses its own variant. Draw.io lets you choose. Pick tools that support your organizational standards, or adapt to what your tools offer.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.