Sobes.tech
Senior

What types of JOINs do you know?

sobes.tech AI

Answer from AI

The main types of JOINs that I know and use:

  • INNER JOIN — returns only the records that match in both tables.
  • LEFT JOIN (LEFT OUTER JOIN) — returns all records from the left table and matching records from the right; if there is no match, NULL is returned.
  • RIGHT JOIN (RIGHT OUTER JOIN) — similar to LEFT JOIN, but for the right table.
  • FULL JOIN (FULL OUTER JOIN) — returns all records from both tables; where there is no match, NULL is returned.
  • CROSS JOIN — the Cartesian product of two tables.

Depending on the task, I choose the appropriate type of JOIN to obtain correct data and optimal performance.

What types of JOINs do you know? — Golang - sobes.tech