The two relationship shapes you'll model 99% of the time
Almost every relational schema is built from two relationship cardinalities:
- One-to-many — one author has many posts. Implemented with a foreign key on the 'many' side.
- Many-to-many — posts have many tags, tags belong to many posts. Implemented with a junction table (also called join table, link table, association table).
One-to-one is rare — usually a sign you should merge the tables, unless you're deliberately splitting hot/cold columns.
Principle: When you find yourself wanting to put a comma-separated list of ids into a TEXT column, stop. That's a junction table screaming to exist. SQL has no good answer for 'find all rows where this column contains 42'; junction tables turn it into an indexed JOIN.