1. 카테이션 곱이란?
- In two sets, the elements are paired with each elements of the other set.
- Each elements pair with every elements of the other set one by one. So the total count of pairs are multiplied.
- That is Cartesian product.
2. 아래의 조인에 대하여 예를 들어 설명하시오.
- 등가 조인
- 비등가 조인
- self 조인
select * from emp, dept;
select * from emp, salgrade;
select * from emp e1, emp e2;
3. 아래의 조인 쿼리문을 완성 하시오.
select dept.dname
from emp, dept
where emp.deptno = dept.deptno and emp.ename = 'ALLEN';
select emp.*, salgrade.grade
from emp, salgrade
where emp.sal between salgrade.losal and salgrade.hisal;
select e.*, m.ename
from emp e, emp m
where e.mgr = m.empno;
4. 아래의 서브쿼리문을 완성하시오.
select *
from emp
where sal > (select avg(sal) from emp);