Task: Text to Code
Input (English): Step 1: For each row in Statements table, find corresponding rows in Documents table and in Accounts table.
Step 2: find the number of rows of each value of Document_ID in the results of step 1.
Step 3: find Accounts's Statement_ID, Statement_Details of the results of step 1 with largest value in the results of step 2
Output (English): SELECT T3.Statement_ID , T2.Statement_Details FROM Documents AS T1 JOIN Statements AS T2 ON T1.Document_ID = T2.Statement_ID AND T1.Document_ID = T2.Statement_ID JOIN Accounts AS T3 ON T2.Statement_ID = T3.Statement_ID GROUP BY T1.Document_ID ORDER BY Count ( * ) Desc LIMIT 1