INNER JOIN
Try it yourself →Joins two tables on a common column.
Syntax
SELECT ... FROM a JOIN b ON a.x = b.y;
Description
Joins related tables (e.g., order + customer) on a common key and queries them together.
Example
CREATE TABLE person(id INTEGER, name TEXT); CREATE TABLE orders(person_id INTEGER, item TEXT); INSERT INTO person VALUES (1, 'Alex'); INSERT INTO orders VALUES (1, 'Pen'); SELECT person.name, orders.item FROM person JOIN orders ON person.id = orders.person_id;
Expected output
Alex|Pen
When to use?
Combining related data (multi-table queries).