title: SQL query: get tag id and number of tag occurences
body: <p>I think, the answer to my question is rather simple, but I just can't figure it out at the moment. I experimented with DISTINCT() and COUNT(), but had no success, although I know, that I did it somehow once before. So:</p>
  
  <p>I have three tables: <code>article</code>, <code>tag</code>, and <code>article_tag</code>. The last one is simply two columns with <code>article_id</code> and <code>tag_id</code> building a unique key.</p>
  
  <p>Now I want a single SELECT statement that delivers me the <code>tag_id</code> and a count of how many times it appears in the <code>article_tag</code> table. Something like</p>
  
  <pre><code>| tag_id  | count   |
  +---------+---------+
  | 1       | 14      |
  | 2       | 3       |
  | 3       | 34      |
  +---------+---------+
  </code></pre>
  
  <p>from a query like:</p>
  
  <pre><code>SELECT tag_id, COUNT(something) AS count 
    FROM article_tag
  </code></pre>
  
  <p>Could someone tell me, how I could get this result? I guess, I should stop coding when it's tending towards 0:00 o'clock...</p>