SQL Joins

A JOIN clause is used to combine rows from two or more tables, based on a related column between them.

OK ! , 👌 now let’s make 2 table to show visually what JOIN is.


So , we have two tables one name : Orders , and Customer

Let’s Join them , By their CustomerID

OUTPUT IS ? :

Different Types of SQL JOINS

  • (INNER) JOIN: Returns records that have matching values in both tables
  • LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
  • RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
  • FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table

Leave a comment