Advertisement
database SQL Joins allow you to combine data from multiple tables so your database can answer real-world questions that a single table alone cannot handle. In this beginner-friendly tutorial, you’ll understand what JOINs are, why they matter, and how to use INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN with simple, clear examples.

Introduction to SQL Joins for Absolute Beginners (with Simple Examples)

5 Min Read Verified Content

If you’ve just started learning databases and SQL, there’s one topic that often feels scary in the beginning: SQL Joins.
But trust me — once you understand the concept, they become one of the most powerful tools in your toolbox.

Think of JOINs like matching two lists based on something they have in common. That’s it.
Nothing magical. Nothing complicated. Just matching things.

Let’s walk through everything step-by-step, slowly and clearly, so even someone completely new (yes — total dummy level) will understand JOINs by the end of this tutorial.




⭐ Why Do We Need JOINs?

Imagine you run a small shop.
You may have:


Table 1: customers

idname
1Alice
2Bob
3Charlie


Table 2: orders

idcustomer_idproduct
11Laptop
22Mouse
31Keyboard
44Monitor


If you want to answer the question:

“Which customer bought which product?”

You can’t do it using just one table.
You need both.
That's where JOINs save the day.




⭐ The Different Types of SQL Joins

We’ll walk through each of these:


  1. INNER JOIN

  2. LEFT JOIN

  3. RIGHT JOIN

  4. FULL JOIN


I’ll keep everything super simple.




⭐ 1. INNER JOIN (The Most Common One)


What it means:

Give me only the data that exists in both tables.

Like:
“Show me customers that actually placed an order.”


Query:

SELECT customers.name, orders.product FROM customers INNER JOIN orders ON customers.id = orders.customer_id;

Result:

nameproduct
AliceLaptop
BobMouse
AliceKeyboard


Notice Charlie is NOT here — because he didn’t order anything.




⭐ 2. LEFT JOIN (Show Everything From the Left Table)

What it means:

Give me all customers,
and add their orders if they have any.

If none, put NULL.

Query:

SELECT customers.name, orders.product FROM customers LEFT JOIN orders ON customers.id = orders.customer_id;

Result:

nameproduct
AliceLaptop
BobMouse
AliceKeyboard
CharlieNULL


Charlie shows up this time — because LEFT JOIN keeps all customers.




⭐ 3. RIGHT JOIN (Opposite of LEFT JOIN)


What it means:

Show all orders,
and include the customer info if there is any.

Query:

SELECT customers.name, orders.product FROM customers RIGHT JOIN orders ON customers.id = orders.customer_id;

Result:

nameproduct
AliceLaptop
BobMouse
AliceKeyboard
NULLMonitor


The order with customer_id = 4 has no matching customer — so name is NULL.




⭐ 4. FULL JOIN (Keep Everything From Both Tables)


Not all databases support FULL JOIN (MySQL doesn’t, PostgreSQL does).

What it means:

Show EVERYTHING — all customers + all orders.


Query (PostgreSQL):

SELECT customers.name, orders.product FROM customers FULL JOIN orders ON customers.id = orders.customer_id;

Result:

nameproduct
AliceLaptop
BobMouse
AliceKeyboard
CharlieNULL
NULLMonitor


This gives the biggest picture.



⭐ Visual Summary (Easy to Remember)


Think of JOINs like circles:

  • INNER JOIN → Only the overlapping part

  • LEFT JOIN → All from left + matching from right

  • RIGHT JOIN → All from right + matching from left

  • FULL JOIN → Every possible row from both


Once you see it like that, it sticks forever.




⭐ Common Beginner Mistakes (And How to Avoid Them)


❌ Mistake 1: Using the wrong column in the JOIN

Make sure you're joining using matching fields (foreign keys), not names or random columns.


❌ Mistake 2: Forgetting the table name

If both tables have a column called id, you MUST specify:

customers.id orders.id

❌ Mistake 3: Thinking LEFT JOIN = INNER JOIN

LEFT JOIN keeps unmatched rows — INNER JOIN doesn’t.

Advertisement
Back to Database