A template for creating the queries and getting their counts