title: How to count the number of times a specific text string appears and group it by other columns
body: <p>I have a table <code>population_table</code> that contains columns with a <code>user_id</code>, <code>provider_name</code>, and <code>city</code>. I want to count the number of times a user appears in each city, per provider. So for instance, I would want the output to look something like this:</p>
  
  <pre><code>provider_name |  Users |  Atlanta | Chicago | New York
  ______________________________________________________
  Alpha            100        50         25        25
  Beta             200       100         75        25
  Kappa            500       300        100       100
  </code></pre>
  
  <p>I tried using:</p>
  
  <pre><code>select provider_name, count (distinct user_id) AS Users, count(city) AS City 
  from population_table
  group by provider_name
  </code></pre>
  
  <p>How can I write this query to get the breakdown of the users per provider per city?</p>