Task: Text to Code
Input (English): Step 1: For each row in Documents table, find the corresponding rows in Documents_with_Expenses table.
Step 2: find rows in the results of step 1 whose Document_Type_Code equals BK.
Step 3: find each value of Documents's Document_ID the results of step 1 along with the number of the corresponding rows to each value
Output (English): SELECT Count ( * ) , T2.Budget_Type_Code FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.Document_ID = T2.Document_ID WHERE T1.Document_Type_Code = "BK" GROUP BY T1.Document_ID