What is a join in MySQL?

In MySQL, joins are used to query data from two or more tables. The query is made using the relationship between certain columns existing in the table.

There are four types of joins in MySQL.

  1. Inner join returns rows if there is at least one match in both tables.
  2. Left join returns all the rows from the left table even if there is no match in the right table.
  3. Right join returns all the rows from the right table even if no matches exist in the left table.
  4. Full join would return rows when there is at least one match in the tables.

Leave a comment

Your email address will not be published. Required fields are marked *