Skip to content · ⁨본문 바로가기⁩
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:

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

한국어

두 테이블 연결하기

두 테이블의 데이터를 동시에 사용하려면 연결해야 합니다. INNER JOIN은 키에 맞춰 행을 짝지어 맞춥니다 — 여기서는 주문의 customer_id과 고객의 id를 연결합니다:

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

열 이름이 어느 테이블에서 온지 모호할 경우, table.column을 작성하여 명확하게 하세요.

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP