Sobes.tech
Junior

What types of join queries exist in SQL?

sobes.tech AI

Answer from AI

  1. INNER JOIN: Returns rows with matching values in both tables.

  2. 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 NULL for columns from the right table.

  3. 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 NULL for columns from the left table.

  4. FULL JOIN (or FULL OUTER JOIN): Returns all rows from both tables. If there are no matches, the result will have NULL for missing columns.

  5. 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 ON condition.