title: SQL query I have a table name student with two columns name and status
body: <p>I have a table name student with two columns <code>name</code> and <code>status</code> </p>
  
  <pre><code>CREATE TABLE student
  (
    name varchar(30) , status varchar(30) 
  );
  
  INSERT INTO student 
  (name, status) 
  VALUES 
  ('a','pass'),
  ('a','fail'),
  ('a','pass'),
  ('b','fail'),
  ('b','fail'),
  ('b','pass');
  </code></pre>
  
  <p>Query should display 3 columns </p>
  
  <pre><code>name pass fail
  a    2      1
  b    1      2
  </code></pre>
  
  <p>i.e. the name of students corresponding to which count of no. of subjects they passed and number of subjects they failed in should be displayed in result.</p>