select * from emp e, dept d where e.deptno = d.deptno;
select * from emp e, dept d where e.deptno = d.deptno order by e.empno;
JOIN을 이해하기 위해서 수기 작성...
select * from customer full outer join orders on customer.custid = orders.custid; --default
select * from customer left outer join orders on customer.custid = orders.custid;
select * from customer right outer join orders on customer.custid = orders.custid;
select * from customer inner join orders on customer.custid = orders.custid;
select 필드 from 테이블 where 조건;
select 필드 from 테이블 where ();
select bookid from book where price >=20000;
select saleprice from orders where bookid in (select bookid from book where price >=20000);
-박지성(고객)의 총 구매(주문)액 (박지성의 고객번호는 1번으로 놓고 작성)
select * from customer, orders where customer.custid = orders.custid and customer.custid = 1;
select sum(saleprice) from customer, orders where customer.custid = orders.custid and customer.custid = 1;