Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN in SQL?

What's the difference between INNER JOIN,
LEFT JOIN,
RIGHT JOIN and FULL JOIN in MySQL?
by

2 Answers

RoliMishra
INNER JOIN - The INNER JOIN keyword selects records that have matching values in both tables.
LEFT JOIN - The LEFT JOIN command returns all rows from the left table and the matching rows from the right table. The result is NULL from the right side if there is no match.
RIGHT JOIN - The RIGHT JOIN keyword returns all records from the right table (table2), and the matching records from the left table (table1). The result is 0 records from the left side if there is no match.
FULL JOIN - The FULL JOIN gets all records from both tables and puts NULL in the columns where related records do not exist in the opposite table.
Shahlar1vxp
There are several types of joins in SQL which are slightly different from each other-
INNER JOIN*-This join returns the rows when there happens to be a match of the rows in both tables.
*LEFT JOIN*- This join returns all the rows from the left table despite the fact whether there are any matches in the right table or not.
*RIGHT JOIN*- This join returns all the rows from the right table despite the fact whether there are any matches in the left table or not.
*FULL JOIN
- This join is used to combine the results of both the right and left outer joins where the joined table will be containing all records from both the tables and fills in 'NULL' for all the missing matches on either side.

Login / Signup to Answer the Question.