SQL Joins help in getting the commonality between SQL Tables ON certain condition or group of conditions being met.

4 Types of Joins, one Inner and 3 types of Outer

  • INNER JOIN
  • LEFT OUTER JOIN
  • RIGHT OUTER JOIN
  • FULL OUTER JOIN

For our example lets consider tables A & B, let table A be the left table and B be the Right table.
Table A has rows ID, Name, Age
Table B has rows ID, Location

INNER JOIN: Returns the rows of A & B provided there is a match

3
4
5
SELECT A.ID, B.Location
FROM A
INNER JOIN A ON A.ID = B.ID;

LEFT JOIN: Return all the Rows of A and the matching rows of B

3
4
5
SELECT A.ID, B.Location
FROM A
LEFT OUTER JOIN B ON ON A.ID = B.ID;

RIGHT JOIN: Return all the Rows of B and the matching rows of A

3
4
5
SELECT A.ID, B.Location
FROM A
RIGHT OUTER JOIN B ON ON A.ID = B.ID;

FULL JOIN: Return all the Rows of A & B provided at-least one match

3
4
5
SELECT A.ID, B.Location
FROM A
FULL OUTER JOIN B ON ON A.ID = B.ID;

ID being the commonality check, to make it very simple we have one check, how ever the condition can have multiple checks grouped with AND or OR

A personal technical diary… To the point… Precise