entity relationship diagrams - what the lines mean



~1 min read


158 words

Yesterday, in talking about Postgres and Subqueries I was trying to represent a relationship between tables. I knew intuitively what I was trying to communicate, but wasn’t sure about the syntax.

Digging into I found Lucidchart1 had put together a pretty useful cheatsheet on entity-relationship diagrams which the information I was looking for (images credit to Lucidchart).

erd line def

Interestingly, I think one of the examples they have in the post doesn’t make a lot of sense given that information.

erd sample relationship In this example, the BankId is the primary key (which means it’s not nullable). As a result, the way I’m reading the above ERD is that we can have zero or one BankId associated with zero too many cars’ FinancedBy.

How you can have zero is beyond me, however, at least I now know why it’s confusing because what the lines mean is no longer a mystery!


Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!