examerioLogin
← Fullstack with Vue.jsQuestion 44 of 62

When you call select_related("author") on a Book queryset, what kind of SQL join does Django generate? Does it always use the same join type?

📘 Explanation

Django chooses the join type based on the field's nullability: INNER JOIN when the ForeignKey is required, and LEFT OUTER JOIN when it's nullable so related-less rows aren't excluded. The wrong answers claim a single fixed join type regardless of nullability or describe mechanisms like CROSS JOIN with Python filtering that Django doesn't actually use.

Related questions

← PreviousNo login needed