What is a SQL join?
A SQL join combines rows from two or more tables based on a related column, letting you answer questions that span multiple tables, such as pairing each order with its customer's details. Common types include inner, left, right and full outer joins, differing in how they treat unmatched rows.
Relational data is spread across tables on purpose, so joins are how you put it back together. A join matches rows using a condition, usually a foreign key equalling a primary key.
The main join types:
- Inner join keeps only rows with a match in both tables.
- Left join keeps all rows from the left table, filling gaps with nulls.
- Right join the mirror of a left join.
- Full outer join keeps unmatched rows from both sides.
Writing joins correctly is where a lot of analysis goes wrong: pick the wrong join type or key and you silently drop or double-count rows.
This is one of iDBQuery's core jobs. From a plain-language question it infers which tables are involved, which keys relate them, and which join type is correct, then writes and runs the SQL for you. Uniquely, its federation engine can join across different sources, a table in PostgreSQL to a spreadsheet, for example, as if they were one database. Every joined result is cited back to its source rows, so you can verify the join did what you expected.
Updated 2026-06-22