General
A quick review of SQL Joins
0 views

SQL Joins, Simply
Join combines rows from two tables, matched on shared column, usually an id.
Example tables:
customers orders
customer_id | name order_id | customer_id | item
1 | Amina 101 | 1 | Bag
2 | Brian 102 | 1 | Shoes
3 | Carla 103 | 5 | Hat
Note: customer_id 5 has no match in customers. Carla has no orders. These gaps show what each join does differently.
_Inner Join _— only matching rows on both sides.
sql
SELECT customers.name, orders.item
FROM customers
INNER JOIN orders ON customers.customer_id = orders.customer_id;
Result: Amina's two orders only. Carla and order 103 drop out, no match.
Left Join — keeps all rows from left table, matched or not.
sql
SELECT customers.name, orders.item
FROM customers
LEFT JOIN orders ON customers.customer_id = orders.customer_id;
Result: Amina's orders plus Carla with NULL item.
Right Join — keeps all rows from right table, matched or not.
sql
SELECT customers.name, orders.item
FROM customers
RIGHT JOIN orders ON customers.customer_id = orders.customer_id;
Result: Amina's orders plus order 103 with NULL name.
Full Join — keeps all rows from both tables.
sql
SELECT customers.name, orders.item
FROM customers
FULL JOIN orders ON customers.customer_id = orders.customer_id;
Result: Amina's orders, Carla with NULL item, order 103 with NULL name. Nothing dropped.
Quick rule
: Inner join = strict match only. Left/right = pick which side to keep fully. Full join = keep everything. Default to inner join unless missing rows matter to your question.
Read original: https://dev.to/mysticg/a-quick-review-of-sql-joins-1ic7
PreviousA Prompt Is a Specification, Not an AssignmentNextA real Carnival Cruise Line email was serving customers malware
Related posts
The Trump Administration Is Wreaking Havoc on the Electoral System Before the Midterms
0Wired

YouTuber Druski is going to make exclusive content for Netflix
0The Verge
Why are Soviet math textbooks so hardcore in comparison to US textbooks? (2017)
0Hacker News
Technofeudalism
0Hacker News
The Linkerd Story: The people Behind The Service Mesh — A new documentary premieres at KubeCon + CloudNativeCon North America 2026
0CNCF Blog
Londres en otoño: barrios, mercados y museos a tu ritmo
0dev.to Watercooler