title: Need proper output in the format below
body: <p>I have a table in this format:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>courseID</th>
  <th>studentID</th>
  <th>result</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>c1</td>
  <td>s1</td>
  <td>pass</td>
  </tr>
  <tr>
  <td>c1</td>
  <td>s2</td>
  <td>fail</td>
  </tr>
  <tr>
  <td>c2</td>
  <td>s1</td>
  <td>fail</td>
  </tr>
  <tr>
  <td>c3</td>
  <td>s3</td>
  <td>pass</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want results in this format:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>courseID</th>
  <th>studentID</th>
  <th>result</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>course</td>
  <td>total students</td>
  <td>passed students</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I have tried this query</p>
  <pre><code>SELECT course, count(course) AS &quot;total_students&quot;
      , (SELECT COUNT(*) FROM table WHERE status = 'pass') AS passed
      , (SELECT COUNT(*) FROM table WHERE status = 'fail') AS failed
  FROM table
  GROUP BY course;
  </code></pre>