JOIN >>>> 카타시안곱 " x "
같은 컬럼이 있으면 곱함....(공통점이 존재해야함)
EQUAL JOIN >>>> WHERE절에 " = "
SELECT * FROM department, employee WHERE employee.dno = department.dno; >>>>중복배제(14출력)
//사원번호,사원이름,소속부서 출력
SELECT eno, ename, dname FROM employee, department
WHERE employee.dno = department.dno and eno=7788;
//테이블과 컬럼
SELECT employee.eno, employee.ename, department.dname, department.dno
FROM employee, department
WHERE employee.dno=department.dno and employee.eno=7788;
//테이블 별칭
SELECT e.eno, e.ename, d.dname, d.dno
FROM employee e, department d
WHERE e.dno=d.dno and e.eno=7788;
NATURAL JOIN >>>>"이름이같고, 유형이같은 컬럼끼리 조인함"
//(오류남........................)
SELECT e.eno, e.ename, d.dname, d.dno
FROM employee e NATURAL JOIN department d
WHERE e.eno=7788;
SELECT e.ename, d.dname, e.salary, s.grade
FROM employee e, department d, salgrade s
WHERE e.dno=d.dno AND salary BETWEEN losal and hisal;
SELECT employees.ename ||'의 직속 상관은 '||manager.ename
FROM employee employees JOIN employee manager
ON employees.manager=manager.eno(+);