liveBook · Manning

Crow's Foot notation

As explained in Grokking Relational Database Design

Crow's Foot notation is an entity-relationship diagram convention that uses crow's-foot symbols to represent relationship cardinality and participation.

Crow's Foot notation is a practical convention for drawing entity-relationship diagrams. Boxes represent entities, lines represent relationships, and symbols show how many instances may participate in each relationship. section 5.2 section 5.5

Read each relationship line by checking the symbols nearest the related entity:

  • The inner symbol shows minimum cardinality: zero or one. section 5.5
  • The outer symbol shows maximum cardinality: one or many. section 5.5
  • Translate requirements into sentences first, such as “A user has zero, one, or more accounts.” section 5.5

User and account

For a banking database, a user may have zero, one, or many accounts, while each account belongs to one and only one user. The user-to-account direction therefore has minimum zero and maximum many; the account-to-user direction has minimum one and maximum one. Both directions can appear on one relationship line, with each set of symbols placed near its related entity. section 5.5

For a many-to-many relationship, add a junction table containing both entities’ primary keys and represent the result as two one-to-many relationships. A weak entity uses its strong entity’s primary key as part of a composite primary key without a different Crow’s Foot representation. section 5.10 section 5.10

Inspect the diagram figure to connect relationship lines with cardinality symbols and entity structure. section 5.10

How Grokking Relational Database Design covers it

How deep it goes
Explains symbol placement, directional cardinality, common relationship conversions, and weak-entity treatment.
Examples
Uses banking user-account relationships and an online-store entity-relationship diagram as concrete applications.
What you can do after
Apply cardinality symbols to represent entity relationships and convert many-to-many relationships into junction-table designs.
How it connects
Connects entity-relationship diagrams with cardinality, junction tables, strong entities, weak entities, and composite primary keys.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.