The matchmaking dance
An INNER JOIN combines two tables on a shared key. Only rows that have a match in both tables survive. If a user has no orders, they don't appear. If an order has no matching user (a foreign-key orphan), it doesn't appear either.
The ON clause
The ON clause defines the match — usually foreign_key = primary_key. Multiple conditions are fine: ON o.user_id = u.id AND o.status = 'paid'. Filters that mention the right-hand table belong in ON if you want LEFT JOIN semantics later — see the LEFT JOIN lesson.
Multi-table joins
Chain JOINs to traverse relationships: user → order → line_item → product. PostgreSQL's planner is smart about reordering joins for performance — your job is to write the joins clearly.