What’s the difference between RIGHT, LEFT, OUTER, INNER, JOIN

The difference is the way the tables are joined if no common records are available.

RIGHT – RIGHT JOIN is the opposite of LEFT JOIN and the same as RIGHT OUTER JOIN. Shows all records from the right table and only matching records from the left table.

LEFT – LEFT JOIN shows all records from the left table does not matter if matching records in the right table exists or not. Also the same as LEFT OUTER JOIN.

JOIN – JOIN is the same as INNER JOINJOIN means to only show records common to both tables. Will only show records if the same ID value exists in all tables used. If we have a product’s table and a categories table, both have columns with name product_id. If the product_id in the product’s table does not match the product_id in the categories table. No results will show.

Image Credits: Photo by Isis França on Unsplash.

More Similar Posts

No results found.