title: i need to pivot a table in sqlite
body: <pre><code>select team,medal,COUNT(*) AS no_of_medals from athletes where medal != 'NA' GROUP BY team,medal order by team,medal
  </code></pre>
  <p>I need output in the following format</p>
  <pre><code>team gold silveR bronze
  USA  3     4     6
  </code></pre>