title: SQL Query to display the name, job, department name salary and grade
body: <p>The question is:</p>
  
  <ul>
  <li>"Create a query that will display the <code>NAME, JOB, DEPARTMENT NAME, SALARY</code> and <code>GRADE</code>(from the <code>SALGRADE</code> table) for all <code>EMPLOYEES</code>."</li>
  </ul>
  
  <p>My code so far:</p>
  
  <pre><code>SELECT e.ename, e.job, d.dname, e.sal, s.grade
  FROM emp e, dept d, salgrade s
  WHERE e.deptno = d.deptno
  </code></pre>
  
  <p>This returns 70 rows, but the result should only produce <strong>14</strong> rows.</p>
  
  <pre><code>EMPLOYEE   EMP JOB   DEPT NAME      EMP SALARY SALARY GRADE                               
  ---------- --------- -------------- ---------- ------------                               
  JAMES      CLERK     SALES                 950            1                               
  SMITH      CLERK     RESEARCH              800            1                               
  ADAMS      CLERK     RESEARCH             1100            1                               
  MARTIN     SALESMAN  SALES                1250            2                               
  WARD       SALESMAN  SALES                1250            2                               
  MILLER     CLERK     ACCOUNTING           1300            2                               
  ALLEN      SALESMAN  SALES                1600            3                               
  TURNER     SALESMAN  SALES                1500            3                               
  BLAKE      MANAGER   RESEARCH             2850            4                               
  CLARK      MANAGER   ACCOUNTING           2450            4                               
  JONES      MANAGER   RESEARCH             2975            4                               
  FORD       ANALYST   RESEARCH             3000            4                               
  SCOTT      ANALYST   RESEARCH             3000            4                               
  KING       PRESIDENT ACCOUNTING           5000            5         
  </code></pre>
  
  <ul>
  <li><code>emp</code> table has <code>empno, ename, job, deptno, comm, sal</code></li>
  <li><code>salgrade</code> table has <code>grade</code></li>
  <li><code>DEPT</code> table has <code>deptno, loc</code></li>
  </ul>