•
15 min read
Pivot queries
In the examples below we will assume a user can be an athlete with one or more coaches via a pivot table with an addition role
column to identify their head coach compared to the rest of the team.
- users (id, name, etc…)
- athlete_user (athlete_id, user_id, role)