INNER JOIN and OUTER JOIN are two different types of SQL joins. They are used to combine rows from two or more tables based on a related column between them.
INNER JOIN: An INNER JOIN returns the rows from both tables where there is a match. If there is no match, the result is zero rows. In other words, it returns only the set of records that match in both Table A and Table B.
OUTER JOIN: An OUTER JOIN returns all the rows from one table and the matched rows from another table. If there is no matching, the result is NULL on the side of the table that doesn’t have a match. Outer Join can be further divided into LEFT OUTER JOIN (returns all records from left table and matched records from right table), RIGHT OUTER JOIN (returns all records from right table and matched records from left table), and FULL OUTER JOIN (returns all records when there is a match in either left or right table).
Note: MariaDB doesn’t support FULL OUTER JOIN, if you need it you can combine LEFT and RIGHT OUTER JOIN to achieve the same result.
Thus, the main difference is: INNER JOIN returns only matching rows, while OUTER JOIN can also return unmatched rows from one table or both.