조인이란

두 개 이상의 테이블들을 연결 또는 결합하여 데이터를 출력하는 것

Untitled

내부 조인(INNER JOIN) - 교집합

SELECT *
FROM employee INNER JOIN department
ON employee.DepartmentID = department.DepartmentID;

Untitled

교차 조인(CROSS JOIN)

SELECT * FROM employee CROSS JOIN department;

Untitled

외부 조인(OUTER JOIN)

SELECT *
FROM employee FULL OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID;

Untitled

SELECT *
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.DepartmentID;