What is the difference between INNER JOIN and LEFT JOIN in SQL?

1 Answers
Answered by suresh

Difference between INNER JOIN and LEFT JOIN in SQL

Difference between INNER JOIN and LEFT JOIN in SQL

INNER JOIN and LEFT JOIN are two types of joins used in SQL to combine rows from two or more tables based on a related column between them.

INNER JOIN:

In INNER JOIN, only the rows with matching values in both tables are included in the result set. If there is no match, the rows are not included.

LEFT JOIN:

In LEFT JOIN, all the rows from the left table are included in the result set, regardless of whether there is a matching row in the right table. If there is no match in the right table, NULL values are filled in for columns from the right table.

So, the key difference between INNER JOIN and LEFT JOIN is that INNER JOIN only includes matching rows, while LEFT JOIN includes all rows from the left table.

Answer for Question: What is the difference between INNER JOIN and LEFT JOIN in SQL?