Domanda di colloquio di Svitla Systems

What’s the difference between LEFT JOIN and RIGHT JOIN?

Risposta di colloquio

Anonimo

14 apr 2025

LEFT JOIN returns all rows from the left table and matching rows from the right table. RIGHT JOIN does the same, but from the perspective of the right table. Functionally they are mirror images of each other, and either can be rewritten into the other by switching table order. Real-world note: You almost never use RIGHT JOIN because it's simply confusing, and most people write readable code with LEFT JOIN anyway.