title: Oracle SQL combining table information and creating output
body: <p>I have two tables in Oracle SQL developer and I am trying to figure out how to display &quot;fname, ssn&quot; and the employees corresponding manager &quot;fname, snn&quot;. Below are the tables that I have created but I cant seem to get the employee information to correspond to their subsequent manager.</p>
  <p>Employee Table</p>
  <pre><code>| EMPLOYEE# | FNAME | LNAME | SNN  | DEPARTMENT_NAME | JOB_TITLE |
  | 1         | jim   | box   |  11  | accounting      | person    |
  | 2         | james | boer  |  22  | IT              | manager   |
  | 3         | tom   | jo    |  33  | IT              | person    |
  | 4         | tim   | quo   |  44  | accounting      | manager   |
  </code></pre>
  <p>Department Table</p>
  <pre><code>| MANAGER_EMPLOYEE# | DEPARTMENT_NAME |
  | 2                 | IT              |
  | 4                 | accounting      |
  </code></pre>
  <p>Desired Output</p>
  <pre><code>| EMPLOYEE NAME  | Employee SSN | MANAGER NAME | MANAGER SSN |
  | jim box        | 11           | james boer   |  22         |
  | tom jo         | 33           | tim quo      |  44         |
  </code></pre>
  <p>This is what I have so far. It just to show the employee info and manager# as I am not sure how to actually get it to link to a managers name then display as what I want for output</p>
  <pre><code>select employee#, fname, lname, employee.department_name, manager_employee# from employee left outer join department on employee.employee# = department.manager_employee#
  union
  select employee#, fname, lname, employee.department_name, manager_employee# from employee right outer join department on employee.employee# = department.manager_employee#;
  </code></pre>