
Fez R. answered 03/21/19
Experienced IT Professional Specializing in Systems and Networking
In the example of 2 tables....
INNER JOIN: shows only information that matches in both tables
LEFT JOIN: shows everything from the first table and displays matching values from table 2 along the results of table 1. you will see null values where data didn't exist in the second table.
RIGHT JOIN: shows everything from the second table and displays matching values from the first table along with the results of table 2. you will see null values where data didn't exist in the first table.
FULL JOIN: will show all the results from both tables. you will see null values where data doesn't exist from either table.
Example: You have table1 with customer information and table2 with customer order information
Use INNER join to only display customers who have placed orders, and the orders that they placed.
Use LEFT join to display all customers, and all orders for them. Some customers that have not placed orders will still show up but will show null.
Use RIGHT join to display all orders, and customers associated with them. If there are any orders that dont have customers associated with them it will display null.
User FULL join to see all customers and all orders in one place. Customers that didnt place any orders will still be displayed. Orders that didn't have customers will also still be shown.
I hope this makes sense.