What types of join queries exist in SQL?
sobes.tech AI
Answer from AI
-
INNER JOIN: Returns rows with matching values in both tables.
-
LEFT JOIN (or LEFT OUTER JOIN): Returns all rows from the left table and matching rows from the right table. If there are no matches, the result will have
NULLfor columns from the right table. -
RIGHT JOIN (or RIGHT OUTER JOIN): Returns all rows from the right table and matching rows from the left table. If there are no matches, the result will have
NULLfor columns from the left table. -
FULL JOIN (or FULL OUTER JOIN): Returns all rows from both tables. If there are no matches, the result will have
NULLfor missing columns. -
CROSS JOIN: Returns the Cartesian product of rows from both tables. It essentially joins each row of the first table with every row of the second table. Does not require an
ONcondition.