ER diagram (ERD) crow's foot notation, examples
Entities, attributes, primary and foreign keys and crow's foot cardinality in an ER diagram, with editable ERD examples such as a shop and a library.
What is a er diagram
An ER diagram is a database blueprint: the things to store (entities), their attributes, and how many of one relate to another (cardinality). It settles the structure before tables are created.
- Database classes and exam questions
- Agreeing on table structure for a new product
- Turning an existing SQL schema into a picture
Symbols and meanings
| Symbol | Meaning |
|---|---|
| Entity | A thing to store: name on top, attributes below. |
| Primary key (PK) | The attribute that identifies one row; underlined. |
| Foreign key (FK) | An attribute pointing to another entity's key. |
| Exactly one | Two short bars at the line end. |
| Zero or one | A bar and a circle. |
| Zero or many | A crow's foot and a circle. |
| One or many | A crow's foot and a bar. |
Basis: Crow's Foot(IE) 표기, 정보처리기사 데이터베이스 설계 범위
How to draw one
- Pick the nouns to store as entities (Member, Order, Product).
- Give each entity a primary key (PK).
- Mark attributes that point to another entity as foreign keys (FK).
- Put cardinality marks on both ends of each relationship: one (bars), zero or one (circle and bar), many (crow's foot).
- Resolve many-to-many with an associative entity (OrderItem).
Paste SQL CREATE TABLE statements as they are, or write Mermaid erDiagram: Entity { type name PK } and Member ||--o{ Order : places.
Common mistakes
- An entity without a primary key.
- A foreign key with no relationship line.
- Cardinality marks on the wrong end.
- A many-to-many relationship left without an associative entity.
The editor's notation check flags these mistakes every time the picture changes.
16 er diagram examples
- Online shop ERD
- Library ERD
- Course registration ERD
- Clinic appointment ERD
- Blog ERD
- Cafe POS ERD
- Message board ERD from SQL
- Employee and department ERD from SQL
- Cinema booking ERD
- Food delivery app ERD
- Hotel reservation ERD
- Gym membership ERD
- Inventory ERD
- One-to-one relationship ERD
- Resolving many-to-many ERD
- Survey ERD