Task: Text to Code
Input (English): SQL: SELECT Template_Type_Code , Count ( * ) FROM Templates GROUP BY Template_Type_Code
Feedback: You need to search all the similar rows for individual value of documents table.
Output (English): SELECT T1.template_type_code ,  count(*) FROM Templates AS T1 JOIN Documents AS T2 ON T1.template_id  =  T2.template_id GROUP BY T1.template_type_code