4가지 기본 죠인
Cross Join, Left Join, Right Join, Inner Join
Inner Join 교집합
Outer Join 합집합
ex1) customer 과 orders 의 join
SELECT *
FROM Customers cs
inner join orders ord ON cs.customerid = ord.customerid
;
ex2)
SELECT *
FROM Customers cs
inner join orders ord ON cs.customerid = ord.customerid
WHERE cs.Country = 'Mexico'
;
ex3)
SELECT cs.customerid, orderdate, orderid, customername
FROM customers cs left join orders od on cs.customerid = od.customerid
where orderdate between '1996-07-01' and '1996-07-31'
order by orderdate desc
;