Glossary

JOIN (SQL)

JOIN is a SQL operator that combines rows from two or more tables based on a matching condition. A proper JOIN replaces dozens of separate queries and is fundamental to working efficiently with relational data.

JOIN types

Example

SELECT u.name, o.total
FROM users u
INNER JOIN orders o ON o.user_id = u.id
WHERE o.status = 'paid';

Performance

JOINs on indexed columns (typically foreign keys) are fast. JOINs on unindexed fields are expensive. EXPLAIN shows whether an index is being used.