--The inner connection is left to match the right table, and there is a corresponding display
--left join is the left table as the Datum match to the right table, if the right table does not have corresponding null
--The right connection is the table that has the right side as the Datum match to the left table, or null if the left table does not correspond
--The full connection is the left table that matches the right table, and if there is no display is null
--Cross Join returns all rows from the left table, with each row in the left table combined with all rows in the right table. Cross joins are also called Cartesian product.
--1) Internal Connection
Select a.*,b.* from ATABLE a inner joins btable B on a.id=b.parent_id;
--2) Left Connection
Select a.*,b.* from ATABLE a LEFT join btable B on a.id=b.parent_id;
--3) Right Connection
Select a.*,b.* from ATABLE a right joins btable B on a.id=b.parent_id;
--4) Fully connected
Select a.*,b.* from ATABLE a full join btable B on a.id=b.parent_id;
--Cross Join
SELECT a.*,b.* from ATABLE a cross JOIN btable B;
--Self-join
SELECT a.*,b.* from ATABLE a,btable b WHERE a.id=b.parent_id;
--2) LEFT outer connection
Select a.*,b.* from ATABLE a left OUTER joins btable B on a.id=b.parent_id;
--3) Right outer connection
Select a.*,b.* from ATABLE a right OUTER joins btable B on a.id=b.parent_id;
--4) Full outer connection
Select a.*,b.* from ATABLE a full OUTER joins btable B on a.id=b.parent_id;
A table ID name B table ID job parent_id
1 Sheets 3 1 23 1
2 Lee 42 34 2
3 Wang Wu 3 34 4
Relationship between a.ID and parent_id
SQL All connections Explained