What You'll Master Here
Entities are the nouns, relationships are the verbs, cardinality is the count rule. A diagram is just those three, written down.
Chapter 1 said the conceptual model is where you name the things that exist and how they relate. This chapter teaches you to do exactly that, precisely, using the language every data professional shares: entities, relationships, and cardinality, drawn as an entity-relationship diagram (ERD).
Those three arrive in that order, and they are the whole job. Step through the three moves below to watch a diagram assemble from nothing; the rest of the chapter is the precision — crow’s-foot symbols, optional versus mandatory, and the one relationship that trips up almost everyone: many-to-many.
The chapter in three moves
A library lends books to its members.
What things does this library keep data about?
- member_id
- full_name
- joined_at
- isbn
- title
- author
Two entities, one box each. Every box lists the attributes all of its instances share, with the identifier underlined.
- Name the entities and their attributes
- Name the relationship as a verb, in both directions
- State the count rule — and spot when it needs a bridge
Entities are the nouns, relationships are the verbs, cardinality is the count rule. A diagram is just those three, written down.
Entities, relationships, and cardinality are the vocabulary of data modeling. Without them, design discussions are vague hand-waving; with them, the whole team can agree on structure before any table exists.
- entity
- A thing the business stores data about: customer, order, product.
- relationship
- A meaningful connection between two entities, named with a verb.
- cardinality
- How many instances of one entity relate to one instance of another.
- ERD
- Entity-relationship diagram: the standard picture of entities and their relationships.
Designing tables before agreeing on entities and relationships. You encode the wrong structure and discover it only after data and code depend on it.
Name entities and relationships before drawing tables.
State cardinality out loud for every relationship.
Use an ERD as the shared language with non-engineers.
Nouns become entities, verbs become relationships, and the words "one", "many", and "optional" become cardinality. Modeling at this level is mostly careful reading of requirements.
Entities, relationships, and cardinality are the shared vocabulary of modeling; master them and conceptual design becomes careful reading, not guesswork.
