Task: Text to Code
Input (English): Step 1: For each row in Document_Structures table, find the corresponding rows in Documents table.
Step 2: for each value of Document_Structures's document_structure_code in the results of step 1, calculate number of rows.
Step 3: show each value of Document_Structures's document_structure_code in the results of step 1 along with the average access_count with smallest value in the results of step 2
Output (English): SELECT T2.access_count , Avg ( T2.access_count ) FROM Document_Structures AS T1 JOIN Documents AS T2 ON T1.document_structure_code = T2.document_structure_code GROUP BY T1.document_structure_code ORDER BY Count ( * ) Asc LIMIT 1