SQL Join - JamesDansie/data-structures-and-algorithms GitHub Wiki
SQL Join
Author James Dansie
A key challenge for data bases is that your data often comes from many different sources. So how do we use data from many sources? In SQL we will use the JOIN method to bring together different sources. JOIN allows to join (shocker) together two different tables into one table. The tricky part is that you need to have a common index between them. For example;
SELECT <select_list>
FROM Table_A A
INNER JOIN Table_B B
ON A.Key = B.Key
Will join table A and table B, and will use A.key to match up A with B using B.key. There are more options for joining tables together. Most of these options relate to how to join missing pieces. The image from here is very helpful;

And a handy cheat sheet from here;