What is Difference Between Inner, Left and Right Join

Yusuf Biberoğlu
2 min readMay 18, 2021

I made this scenario easier to understand by visualizing it.

Assume that scenario;

There are 100 students.

There are 50 lockers.

70 students have lockers.

Some of the lockers are shared by a few students.(40 lockers are shared)

Some lockers are not used by anyone (10 lockers are completely empty)

INNER JOIN: Returns students who use lockers only. 70 rows.

LEFT JOIN: It returns both students who do not use lockers and those who use lockers. All 100 students.

RIGHT JOIN: would be “show me all lockers, and the students assigned to them if there are any”.
This could be used to identify lockers that have no students assigned, or lockers that have too many students.
Returns 80 rows (list of 70 students in the 40 lockers, plus the 10 lockers with no student)

The first person who write this, click to view from stackoverflow).

— — —

https://yusufbiberoglu.com

mail@yusufbiberoglu.com

Here’s my articles which might interest you;

Testing Benford’s Law on Symfony 5, Php Framework

Formats Supported by the API Platform

How Computer Works and What is Binary Number System?

--

--