8. Inner and Outer Joins: Step 3

Demo

Show all Employee names with their Department location - format 3

Yet another format makes the join condition explicit and distinct from other selection conditions:

SQL

SELECT ename, location FROM emp INNER JOIN dept ON emp.deptno = dept.deptno;

Output

ename location
CLARK New York
KING New York
MILLER New York
SMITH Dallas
JONES Dallas
SCOTT Dallas
ADAMS Dallas
FORD Dallas
ALLEN Chicago
WARD Chicago
MARTIN Chicago
BLAKE Chicago
TURNER Chicago
JAMES Chicago

Discussion

Progress

Proceed to Next step