CREATE TABLE documents (document_name VARCHAR, document_code VARCHAR)
CREATE TABLE document_sections (document_code VARCHAR)

What is the name of the document 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
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 NULLS LAST LIMIT 1