What is the id and type code for the template used by the most documents?
create table documents (template_id varchar, PRIMARY KEY (template_id)); create table templates (template_type_code varchar, template_id varchar, PRIMARY KEY (template_type_code))
select t1.template_id, t2.template_type_code from documents as t1 join templates as t2 on t1.template_id = t2.template_id group by t1.template_id order by count(*) desc limit 1