# Crow's foot notation Crow's foot notation encodes two things at each end of a relationship: how many, and whether it is optional. Once you can read the marks, most ER diagrams become unambiguous. Both marks matter. Optional versus mandatory is the half people forget, and it is the half that causes arguments about nullable columns. --- ## When to reach for one * Learning to read ER diagrams somebody else drew. * Reviewing a schema where the nullability is the question. * Agreeing notation across a team before drawing anything. --- ## How to draw it in Capable | **Route** | **Use when** | | --------- | ----------------------------------------------------------------- | | Mermaid | The symbols map directly onto its erDiagram syntax. | | draw.io | Teaching diagrams where you want to annotate the notation itself. | --- ## A worked example Each line below is a different cardinality: ![Crow's foot notation](https://help.gocapable.com/images/att1418133537.svg) The source, which you can paste into a new diagram and edit: ``` erDiagram AUTHOR ||--o{ BOOK : "writes (one to zero or many)" BOOK ||--|| ISBN : "has exactly one" READER }o--o{ BOOK : "borrows (many to many, both optional)" PUBLISHER ||--|{ BOOK : "publishes (one to one or many)" ``` --- ## The marks | **Symbol** | **Reads as** | **In Mermaid** | | ------------------- | ------------ | -------------- | | Bar, bar | Exactly one | \|| | | Bar, crow's foot | One or many | \|{ | | Circle, crow's foot | Zero or many | o{ | | Circle, bar | Zero or one | o\| | --- ## A few things that catch people out * The mark nearest the entity is the minimum; the mark furthest is the maximum. * A circle means zero, so it means optional. A bar means one, so it means mandatory. * Many-to-many with no join entity is fine on a conceptual diagram and wrong on a physical one. --- ## Related [Database schema diagramTypes, defaults and foreign keys, from text.](https://help.gocapable.com/diagrams/database-schema-diagram.html) [Data model diagramConceptual, logical, physical, and why they differ.](https://help.gocapable.com/diagrams/data-model-diagram.html) [ExamplesWorking diagrams you can copy.](https://help.gocapable.com/diagrams/examples.html) --- _Get the cardinality right and the rest follows._