I have 3 tables: 'cards', 'tags' and 'cardstags', where cards HABTM tags
Question: What query do I execute on the 'tags' table to count the number of associated 'cards' rows?
I'm looking for something like this:
tags.name | count
----------+------
cricket | 15 (15 cards are tagged as 'cricket')
soccer | 23
football | 12