Find the list of documents that are both in the most three popular type and have the most three popular structure.
CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR)
SELECT TOP 3 * FROM (SELECT TOP 3 document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC) AS _l_0
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR) Question: Find the list of documents that are both in the most three popular type and have the most three popular structure. [/INST] SELECT TOP 3 * FROM (SELECT TOP 3 document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC) AS _l_0 </s>