반응형
#with 절
- liveoralce에서는
with bigdepts(bdno)
(select dno
from employee
group by dno
having count(*) > 3)
select dno, count(*)
from employee
where salary > 40000 and dno in (select bdno from bigdepts)
#case 문
- live oracle에서는 마지막에 END; 로 끝나야 함
#Recursive
- live oracle에서는 지원 안함
#JOIN vs NESTED
- 사람이 이해하기는 nested가 쉽지만 연산 효율은 join이 더 좋음
- nested는 for 루프처럼 돌아감.
ex) r은 100개 튜플, s는 1000개 튜플이라면
> nested = 100 * 1000번 연산
> join = 100*1000번 연산
> 같지만 join은 조건이있을 시 필터링 먼저 함 - 100*1000을 20*50으로 줄이는 식으로 탐색 전에 선 필터링
> 즉 최소한 join이 nested보다 나쁘게 수행되는 경우는 없다.
> 모든 join을 nested로 바꿀 순 있지만 반대는 아님
반응형
'CS > DB' 카테고리의 다른 글
[DB] 기본 Query (0) | 2023.09.12 |
---|---|
[DB] 무결성 제약 조건 (0) | 2023.09.05 |
[DB] DB의 특징 (0) | 2023.08.29 |