Relational Database Systems Concepts, Design, SQL, PostgreSQL, MySQL, and Applications

Appendices

Appendix F. ER Diagram Symbols and Examples

The drawing vocabulary of Chapter 5: Chen and crow's-foot symbols, the constraint annotations, and worked examples on the university schema.

Chen notation

ElementSymbolMeaning
(Strong) entityRectangleIndependently identified thing
Weak entityDouble rectangleIdentified only via its owner
AttributeOvalProperty of an entity/relationship
Key attributeOval, name underlinedThe identifier
Multivalued attributeDouble ovalA set of values
Derived attributeOval, dashed borderComputable (not stored)
RelationshipDiamondAssociation among entities
Identifying relationshipDouble diamondOwner → weak entity
Cardinality (1:1, 1:N, M:N)Labeled diamond edgesPairing rule
Total participationDouble lineEvery instance participates
Partial participationSingle lineSome instances may not
Specialization (ISA)Triangle labeled ISASupertype → subtypes
AggregationRectangle around a relationshipRelationship as an entity

Crow's-foot notation

End mark (at the many side)Meaning
—||Exactly one
—|oZero or one
—< (crow's foot)Many (one or more)
—o<Zero or many
Double/mandatory bar or solid crow's foot conventionsTotal participation (tool-dependent)

Reading rule: walk each line aloud as entity-verb-entity with cardinality ("a department offers many courses").

The university ERD, crow's foot

 DEPARTMENT ──< OFFERS >── COURSE ──< RUNS >── COURSE_SECTION
     │                     (1 dept : N courses)   (1 course : N sections)
     │
     ├─o< MAJORS >── STUDENT ──< ENROLLS >── COURSE_SECTION
     │              (1 dept : N students)  (M:N, attribute: grade)
     │
 INSTRUCTOR ──< TEACHES >── COURSE_SECTION
              (1 instructor : N sections; partial on both sides)

The same facts, Chen fragments

     ┌────────┐  offers   ┌───────┐             (1,N)      (1,1)
     │DEPART- ├────< >───┤ COURSE│        DEPARTMENT ══ offers ══< COURSE
     │ MENT   │          └───────┘        (double line = total: every course
     └────────┘                             is offered by a department)

   STUDENT ══< enrolls >══ COURSE_SECTION      grade hangs on the diamond
            (partial participation on both sides)

Weak entity and specialization, drawn

  COURSE ══< has-section >══ ╔════════════╗        double rectangle:
                                 (weak)    ║ SECTION  ║        identified by
        owner          identifying        ╚════════════╝        (course_id,
                     (double diamond)     discriminator: section_no   section_no, term)

                    ┌────────┐
                    │ PERSON │
              ISA  /     │     \        specialization, disjoint or
                 ┌─────┐ ┌──────┐ ┌───────┐   overlapping; total or partial
                 │STU- │ │INSTR │ │ALUMNUS│
                 │DENT │ │UCTOR │ └───────┘
                 └─────┘ └──────┘

Constraint annotations to write beside any diagram

  • Cardinality per direction (1:1 / 1:N / M:N).
  • Participation per side (total/mandatory vs optional).
  • Weakness: owner + discriminator + identifying relationship.
  • Specialization: disjoint vs overlapping; total vs partial.
  • Relationship attributes (the grade, the quantity — never on the entity).
  • Business rules that will become constraints (the data-dictionary companion).

Diagram hygiene (the professional rules)

  1. Name relationships with verb phrases; read the diagram aloud as sentences to review it.
  2. Attributes in ovals only for small diagrams; real diagrams keep attributes in the data dictionary.
  3. Mark keys explicitly — the diagram states identity.
  4. Keep subtypes and weak entities marked, not implied.
  5. The diagram communicates; the data dictionary specifies. Both travel together.