SQL Joins 101 — A Guide to Data Fusion

Carlos da Costa
6 min readNov 27, 2023
Photo by Claudio Schwarz on Unsplash

No Medium subscription? Read here — Free Access

Real-world databases are like puzzles composed of multiple tables with different relationships therefore a query might be composed of more than one table. Using joins we can combine rows from two or more tables enabling a more comprehensive analysis of our data. Imagine that you are a data analyst at an online retail company, and your manager tasks you with obtaining a list of products purchased by customers under 30 years old. How would you tackle this challenge? Well as you have guessed, the answer lies in the power of joins.

In this article, we’ll unravel the mysteries of joins and explore how they play a crucial role in extracting meaningful insights from complex databases.

For this tutorial, we will be using a database named EasyBuyDB with four tables: Customer, OrderDetails, Orders and Products.

DB ER

We will explore five fundamental types of joins, each serving a unique purpose in the realm of database queries:

  • Inner Join
  • Left Join
  • Right Join
  • Full Join

--

--

Carlos da Costa
Carlos da Costa

Written by Carlos da Costa

A data science enthusiast making data-related concepts accessible to everyone. Let's connect @ https://www.linkedin.com/in/carlosdavidcosta

Responses (1)