# comment Owner ← table: no indent Id ← int, primary key Name ← no type = vc Email vc unique Dog OwnerId -> Owner ← FK to its PK OwnerMail -> Owner.Email DogToShow ← no Id = no PK… DogId -> Dog ShowDate date Place int pk (DogId, ShowDate) ← …unless pk unique (ShowDate, Place)
pknulluniqueauto_incrementpk (A, B)unique (A, B)index-> Table-> T.Col[delete cascade][default 0]OwnerIdvc# e.g. A, BER diagrams model any kind of system, before anyone has decided how it will be stored. That is why ER has 1‑1, 1‑N and N‑N relationships.
A SQL database is more concrete. It has tables with columns, and a foreign key is a column that points to a column in another table. That link is 1‑N by nature: many rows can hold the same key, and each of them points to exactly one row.
- 1‑1 is that same link narrowed: the foreign key is marked
unique, so each key can appear only once (drawn here as 1‑1). Often those columns simply belong in the same table. - N‑N doesn't exist between two tables. It is always built as a junction table with two foreign keys, in other words two 1‑N links.
Why it's everywhere: ER notation comes from 1970s design methods: Chen's ER model, and crow's feet from Information Engineering. The database design tools of the 80s and 90s kept those symbols when they started drawing real tables, and still call the result an "ER diagram". Textbooks and tutorials copied them, so that is what a web search shows.
The arrows show exactly which column points to which, and that is what you need to write a JOIN. ER symbols only tell you that two tables are related.