Перейти к содержанию
English
Joining two tables

To use data from both tables at once, you join them. An INNER JOIN pairs up rows that match on a key — here, the order's customer_id with the customer's id:

SELECT customer.name, orders.total
FROM customer
INNER JOIN orders ON customer.id = orders.customer_id;

When a column name could come from either table, write table.column so it is clear.

Students joined to Forms on formid pairs Mia and Ana with Ms Ng and Leo with Mr Li

Раздаточный материал

Войти или создать аккаунт

IGCSE, A-Level & AP