title: Fetch how many failure and success did each person (name) have
body: <p>I have a table <code>buggy</code>, the dummy dataset link can be see here
  <a href="https://github.com/FirzaCank/Project/blob/main/SQL/IFG%20test/Dataset%20Dummy%20no%205.sql" rel="nofollow noreferrer">https://github.com/FirzaCank/Project/blob/main/SQL/IFG%20test/Dataset%20Dummy%20no%205.sql</a></p>
  <p>Which contains:</p>
  <ol>
  <li>id (INT)</li>
  <li>name (VARCHAR)</li>
  <li>bug (INT, contains the numbers 0 and 1)</li>
  </ol>
  <p>With dataset explanations on 'bug' column are:</p>
  <ul>
  <li>0, it means fault / failure</li>
  <li>1, it means success</li>
  <li>If there is no 'fault', then the 'fault' value will be filled with '0' (null is okay too), so is 'success'</li>
  </ul>
  <p>I've tried a MySQL query like this:</p>
  <pre><code>SELECT name,
      CASE
      WHEN bug = 0 THEN COUNT(bug)
      END AS failure,
      CASE
      WHEN bug = 1 THEN COUNT(bug)
      END AS success
  FROM buggy
  GROUP BY name;
  </code></pre>
  <p>The desire output is like <a href="https://i.stack.imgur.com/KhfiC.jpg" rel="nofollow noreferrer">This</a>, but as far as I've tried in the above syntax it just came out like <a href="https://i.stack.imgur.com/5fPyV.jpg" rel="nofollow noreferrer">this</a></p>
  <p>Thank you for the help!</p>