SELECT template_id ,  count(*) FROM Documents GROUP BY template_id
Show all template ids and number of documents using each template.
SELECT template_id , count ( * ) FROM Documents GROUP BY template_id
select template_id , count ( * ) from documents group by template_id
Show all template ids and number of documents using each template .