title: MySQL5 Query Help to find non-validating rows of join
body: <p>Find below the test tables:</p>
  
  <pre><code>SELECT * FROM tbl_emp; // There must be few employee with no dept id (did)
  +------+-------+------+
  | eid  | ename | did  |
  +------+-------+------+
  |    1 | SCOTT |    2 |
  |    2 | JAMES |    4 |
  |    3 | BOND  |    1 |
  |    4 | TIGER |    5 |
  |    5 | CHIP  |    0 |
  |    6 | DALE  |    0 |
  |    7 | MARY  |    0 |
  +------+-------+------+
  
  SELECT * FROM tbl_dept;// There must be few depts which have no employee.
  +-------+-------------+
  | dptid | dname       |
  +-------+-------------+
  |     1 | HR          |
  |     2 | IT          |
  |     3 | ADMIN       |
  |     4 | TRAVEL      |
  |     5 | SALES       |
  |     6 | FINANCE     |
  |     7 | ENGINEERING |
  +-------+-------------+
  </code></pre>
  
  <p>I want to list all the employee name from tbl_emp which does not have dept and all the dname from tbl_dept which have no employee in a SINGLE QUERY in following manner:</p>
  
  <pre><code>DESIRED RESULTSET:
  -------------------
  ename  dname
  CHIP    
  DALE
  MARY
         ADMIN
         FINANCE
         ENGINEERING
  -------------------
  </code></pre>
  
  <p>All I could do is:</p>
  
  <pre><code>SELECT ename FROM tbl_emp WHERE did NOT IN (SELECT dptid FROM tbl_dept);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>SELECT dname FROM tbl_dept WHERE dptid NOT IN (SELECT did FROM tbl_emp);
  </code></pre>
  
  <p>Please help in select both dname and ename and that too in single query.</p>