Select Distinct
Select Distinct
  • Home
  • Services
  • About
  • Tips and Timesavers
  • Resources
  • Careers
  • Contact Us
  • Blog
  • Management Info Survey
  • More
    • Home
    • Services
    • About
    • Tips and Timesavers
    • Resources
    • Careers
    • Contact Us
    • Blog
    • Management Info Survey
  • Home
  • Services
  • About
  • Tips and Timesavers
  • Resources
  • Careers
  • Contact Us
  • Blog
  • Management Info Survey

SQL Joins

More SQL Tips

Use LEAD and LAG in SQL

How to use SQL joins


This short guide explains how to use the different types of SQL join


Joins are used to link two tables from the same database. There are four types of joins, each unique and as useful as one another



This includes inner join, full outer join, left join and right join 


This tutorial presents joins in an easy to understand style



Inner joins in SQL

Inner join

Inner joins can be used to show everything in the 2 tables entered that match, else they will not be shown. 


These can be useful to get important information across tables all in one place, like an ID number, a name and a salary. 

Inner join in SQL

Outer joins in SQL

Outer join

Full outer joins can be used to show everything across two tables no matter if the headings cross over, any information not inside one of the tables will be declared NULL. 


This can be useful because it could show that important data is missing which may be necessary. For example, you may have an employee ID number and a name in one table and wages in another and you will be able to tell if anything is missing when NULL appears.  

outer join in SQL

Left joins in SQL

Left join

These can be used to show everything in the left table (the first one entered into you SQL query) regardless of what’s in the right table (the second one entered into you SQL query). 


This can be useful when this can be useful as it shows all in the left table and if it isn’t in the right is classified NULL. 


This may help as you can see what is needed for the right table to fill it all out. 

Left join in SQL

Right joins in SQL

Right join

These can be used to show everything in the right table (the second one entered into you SQL query) regardless of what’s in the left table (the first one entered into you SQL query). 


This can be useful when this can be useful as it shows all in the right table and if it isn’t in the left is classified NULL. 


This may help as you can see what is needed for the left table to fill it all out. 

Right join in SQL

Subscribe

Sign up to hear more tips

Copyright © 2022 Select Distinct Limited - All Rights Reserved.

  • Privacy Policy

This website uses cookies.

We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.

DeclineAccept