nested loop:
select empno, ename, dname, loc
from emp, dept
where emp.deptno = dept.deptno
for each row in (select empno, ename, deptno from emp) loop
for (select dname, loc from dept where deptno = outer.deptno) loop
If match then pass the row on to the next step
If inner join and no match then discard the row
If outer join and no match set inner column values to null
and pass the row on to the next step
end loop
end loop