What are all the documents?
select * from documents
Show their names in the order of number of sections.
select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code group by t1.document_code order by count(*)
What is the name of the one with the most number of sections?
select t1.document_name from documents as t1 join document_sections as t2 on t1.document_code = t2.document_code group by t1.document_code order by count(*) desc limit 1