Task: Text to Code
Input (English): Step 1: For each row in Templates table, find the corresponding rows in Documents table.
Step 2: find the number of rows of each value of Documents's Template_ID in the results of step 1.
Step 3: find Version_Number, Template_Type_Code in the results of step 1 whose corresponding value in step 2 is greater than 5
Output (English): SELECT T1.Version_Number , T1.Template_Type_Code FROM Templates AS T1 JOIN Documents AS T2 ON T1.Template_ID = T2.Template_ID GROUP BY T2.Template_ID HAVING Count ( * ) > 5