: 이름과 타입이 같은 모든 컬럼을 기준으로 조인을 수행

  : 문제점 (무조건 같은 이름을 기준으로 조인)

    - 속도가 느리다

    - 원치 않는 조인이 이루어질 가능성이 있다.

  : 문제해결 -> join using, join on을 사용


  select department_id, department_name, location_id, city

  from departments

  natural join locations;



<Oracle Syntax>

  

  select department_id, department_name, departments.location_id, city

  from departments, locations

  where departments.location_id = locations.location_id;



select department_id, department_name, location_id, city

from departments

natural join locations

where department_id in (20, 50);


↓ ↓ ↓

select department_id, department_name, departments.location_id, city

from departments, locations

where departments.location_id = locations.location_id --> join predicate

and   department_id in (20, 50); --> non-join predicate


+ Recent posts