api: "YAML JSON TOON Database" version: 1.0.0 format: json dataset: slug: sql-join-types title: "SQL Join Types" description: "Reference for all SQL JOIN types and their use cases." category: "Database Types" category_slug: database-types tags: "database,sql,joins,reference" view_count: 0 data [6]{type,description,syntax}: "INNER JOIN","Returns rows where there is a match in both tables.","SELECT * FROM a INNER JOIN b ON a.id = b.a_id" "LEFT JOIN","Returns all rows from the left table and matched rows from the right.","SELECT * FROM a LEFT JOIN b ON a.id = b.a_id" "RIGHT JOIN","Returns all rows from the right table and matched rows from the left.","SELECT * FROM a RIGHT JOIN b ON a.id = b.a_id" "FULL OUTER JOIN","Returns all rows from both tables, with NULLs for non-matches.","SELECT * FROM a FULL OUTER JOIN b ON a.id = b.a_id" "CROSS JOIN","Returns the Cartesian product of both tables.","SELECT * FROM a CROSS JOIN b" "SELF JOIN","A table joined with itself. Useful for hierarchical data.","SELECT * FROM employees e1 JOIN employees e2 ON e1.manager_id = e2.id"