Cardinality and ER Notation

Cardinality and ER Diagram Notation

Cardinality says how many rows on each side of a relationship can pair up. Its maximum gives the shapes 1:1, 1:N and N:M; its minimum is zero (optional) or one (mandatory). Crow's foot notation, introduced by Gordon Everest in 1976 and drawn by MySQL Workbench 524 , puts the maximum next to the entity (a bar for one, a fork for many) and the minimum behind it (a circle for zero, a bar for one). Read from one entity to the far end: "one order contains one or more items."

The shop in crow's foot notation. Each end shows how many rows of the entity beside it pair with one row at the far end
The shop in crow's foot notation. Each end shows how many rows of the entity beside it pair with one row at the far end

Orders and products are N:M, drawn here already resolved into the associative entity Order item and two 1:N lines. Categories form a recursive relationship. Cardinality comes from business rules, so ask the owner; no foreign key can enforce "at least one item," so PHP must.