Task: Text to Code
Input (English): Step 1: For each row in Ref_Locations table, find the corresponding rows in Document_Locations table.
Step 2: find each value of Document_Locations's Location_Code in the results of step 1 along with the number of the corresponding rows to each value
Output (English): SELECT T1.Location_Code , Count ( * ) FROM Ref_Locations AS T1 JOIN Document_Locations AS T2 ON T1.Location_Code = T2.Location_Code GROUP BY T2.Location_Code