Here is our latest fast guide explaining joins in SQL.
This video covers inner joins, full outer joins, left joins and right joins.
#sql #joins #sqljoins
2. Joins are used to link 2 tables
from the same database.
There are 4 types of joins, each
unique and as useful as one
another
3. Inner join
To use an inner join we need 2 tables with the
same column in each, this allows them to join.
Wages table
EmployeeInfo table
The common column is EmployeeNum.
As you can see some data is missing, this is because
some of the data isn’t the same across both tables.
4. Outer join
To use an outer join we need 2 tables with the
same column in each. However, this fills any
information out with null that isn’t the same as
the other table.
Wages table
EmployeeInfo table
The common column is EmployeeNum.
No data is missing this time, however
the pieces of data in one table and
not the other is classified as null.
5. Left join
To use a left join you need 2 tables but it will
show everything in the left table (the first one
you input into your code) regardless of the right
table (the second table you input into your code).
Wages table
EmployeeInfo table
The common column is EmployeeNum.
This shows all the data in the left table no matter
what and any information not in the right is
classified as null.
6. Right join
To use a right join you need 2 tables but it will
show everything in the right table (the second
one you input into your code) regardless of the
left table (the first table you input into your
code).
Wages table
EmployeeInfo table
The common column is EmployeeNum.
This shows all the data in the right table no matter
what and any information not in the left is
classified as null.