title: How to return all departments which have no female employees and the number of male employees
body: <p>Given a database design similar to the following:</p>
  <pre><code>EMPLOYEE: ID, Gender, Salary, DEPT_ID
  </code></pre>
  <p>I have written the following &quot;pseudo-SQL&quot; in an effort to illustrate the output I want, I am trying to simultaneously find the count of female and male employees, then filter to just the ones with no female employees, and finally return the number of males in that department.</p>
  <pre><code>SELECT males, dno FROM
  (SELECT COUNT(Gender = 'male') AS males, COUNT(Gender = 'female') AS females, DEPT_ID
  FROM EMPLOYEE
  GROUP BY Dno)
  WHERE females = 0;
  </code></pre>
  <p>This is not valid COUNT syntax but hopefully can serve as an illustration.</p>