Skip to content

INNER JOIN

Medium — good to knowDatabase

ELI5 — The Vibe Check

INNER JOIN only returns rows where there is a match in BOTH tables. If a user has no orders, they do not appear in the result. It is the strictest JOIN — both sides must have a match for the row to show up.

Real Talk

INNER JOIN returns only the rows where the join condition is satisfied in both tables. Rows with no match in either table are excluded from the result set. Writing JOIN without specifying a type defaults to INNER JOIN in standard SQL.

Show Me The Code

-- Only orders that have a matching user
SELECT u.name, o.total
FROM orders o
INNER JOIN users u ON o.user_id = u.id;

When You'll Hear This

"Use INNER JOIN when you only want rows that exist in both tables." / "INNER JOIN is the default if you just write JOIN."

Made with passive-aggressive love by manoga.digital. Powered by Claude.