Diagram Conventions   «Prev  Next»

Lesson 6Diagramming types of participation
ObjectiveIdentify symbols for participation (mandatory vs optional) and read them correctly in Crow’s Foot and Chen notations.

Mandatory and Optional Participation in ER Diagrams

Participation specifies the minimum number of related rows an entity must have in a relationship. It pairs with cardinality (maximum). The semantics are the same across notations; only the symbols differ.

Two common notations

  • Crow’s Foot (Information Engineering):
    • Minimum (participation): | = at least one (mandatory), O = zero allowed (optional).
    • Maximum (cardinality): | = one, < = many.
  • Chen:
    • Minimum: double line = total (mandatory), single line = partial (optional).
    • Maximum: markers such as 1 and N near entity–relationship connections.

Reading the diagrams

Start with one instance of an entity and read the symbols at the opposite end to count its related instances. The markers next to PRODUCT count products for one supplier; the markers next to SUPPLIER count suppliers for one product.

Examples with participation

Employee-office optional one-to-one: each office requires exactly one employee; an employee may have zero or one office. Office EmpID is a unique, non-null foreign key.
1:1 with participation - The two bars beside EMPLOYEE require each office to have exactly one employee. The circle and bar beside OFFICE allow each employee to have zero or one office. In Chen notation, OFFICE has total participation in this relationship and EMPLOYEE has partial participation.

Supplier-product one-to-many: each product requires exactly one supplier; a supplier may have zero or many products.
1:N with participation - Next to SUPPLIER you see || (exactly one supplier per product). Next to PRODUCT you see O< (zero or many products per supplier). Read: every product must have exactly one supplier; a supplier can have zero, one, or many products.

Student-class many-to-many resolved through STUDENT_CLASS: each junction row requires one student and one class; either parent may have zero or many junction rows.
M:N with participation - The diagram already resolves the many-to-many relationship through STUDENT CLASS. Each junction row references exactly one student and one class. A student or class may have zero or many junction rows, forming two one-to-many relationships.

Database Modeling

Implementation patterns

The following examples use Oracle SQL syntax and are illustrative; they have not been executed against a live Oracle database in this revision.

1) One-to-one

Shared primary key (tight coupling):


CREATE TABLE employee (
  emp_id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  last_name  VARCHAR2(60) NOT NULL,
  first_name VARCHAR2(60) NOT NULL
);

CREATE TABLE office (
  emp_id   NUMBER PRIMARY KEY,             -- shared PK enforces 1:1
  room_no  VARCHAR2(20) NOT NULL,
  CONSTRAINT fk_office_emp
    FOREIGN KEY (emp_id) REFERENCES employee(emp_id)
);

Unique foreign key (looser coupling):


CREATE TABLE office_uq (
  office_id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  emp_id    NUMBER UNIQUE NOT NULL,        -- one office per employee
  room_no   VARCHAR2(20) NOT NULL,
  CONSTRAINT fk_office_uq_emp
    FOREIGN KEY (emp_id) REFERENCES employee(emp_id)
);

Both one-to-one patterns allow an employee to have no office while requiring every office row to reference exactly one employee. They implement the optional-office rule shown in the first diagram. A different rule requiring every employee to have an office would need additional enforcement.

2) One-to-many


CREATE TABLE supplier (
  supplier_id   NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  supplier_code VARCHAR2(20) UNIQUE NOT NULL,
  name          VARCHAR2(120) NOT NULL
);

CREATE TABLE product (
  product_id  NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  supplier_id NUMBER NOT NULL,             -- mandatory one
  sku         VARCHAR2(40) UNIQUE NOT NULL,
  title       VARCHAR2(120) NOT NULL,
  CONSTRAINT fk_product_supplier
    FOREIGN KEY (supplier_id) REFERENCES supplier(supplier_id)
);

3) Many-to-many (resolved)


CREATE TABLE student (
  stud_id     NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  student_no  VARCHAR2(20) UNIQUE NOT NULL,
  last_name   VARCHAR2(60) NOT NULL
);

CREATE TABLE class (
  class_id    NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  class_code  VARCHAR2(20) UNIQUE NOT NULL,
  title       VARCHAR2(120) NOT NULL
);

CREATE TABLE enrollment (
  stud_id     NUMBER NOT NULL,
  class_id    NUMBER NOT NULL,
  enrolled_on DATE DEFAULT SYSDATE,
  grade       VARCHAR2(2),
  CONSTRAINT pk_enrollment PRIMARY KEY (stud_id, class_id),
  CONSTRAINT fk_enr_stud  FOREIGN KEY (stud_id)  REFERENCES student(stud_id),
  CONSTRAINT fk_enr_class FOREIGN KEY (class_id) REFERENCES class(class_id)
);

Participation vs. identifying relationships

Don’t conflate mandatory with identifying. Mandatory means the minimum is at least one; identifying means the parent’s PK participates in the child’s PK. A child with its own primary key can have a mandatory, non-identifying foreign key. If the parent key is part of the child primary key, that child cannot omit the parent because primary-key columns cannot be NULL. The parent may still have zero children; always state which direction is optional.

Referential actions on delete

Referential actions differ by database. Oracle supports ON DELETE CASCADE and ON DELETE SET NULL; omitting ON DELETE prevents deletion of a referenced parent. The list below describes common SQL choices across products:


-- Alternative business rule: a product may temporarily have no supplier.
ALTER TABLE product DROP CONSTRAINT fk_product_supplier;
ALTER TABLE product MODIFY (supplier_id NULL);

ALTER TABLE product
  ADD CONSTRAINT fk_product_supplier
  FOREIGN KEY (supplier_id)
  REFERENCES supplier(supplier_id)
  ON DELETE SET NULL;  -- example: product may temporarily have no supplier

This alternative deliberately changes product participation from mandatory to optional. Dropping the original constraint and allowing NULL are necessary before replacing the foreign key with ON DELETE SET NULL.

Quick self-check

Given SUPPLIER ||-----O< PRODUCT, answer:

  1. Is a product required to have a supplier? (Yes: the two bars near SUPPLIER specify exactly one supplier per product.)
  2. Can a supplier have zero products? (Yes: the circle and crow's foot near PRODUCT specify zero or many products per supplier.)

ER Diagram Participation - Exercise

Before moving on to the next lesson, click the Exercise link below to check your mastery of relationship constructs and participation symbols.
ER Diagram Participation - Exercise
The next lesson discusses the importance of meeting again with the database's eventual end users to determine if any revisions to the completed ER diagram are needed.

SEMrush Software 6 SEMrush Banner 6