Task: Text to Code
Input (English): Step 1: For each row in bank table, find the corresponding rows in loan table.
Step 2: find each value of bank's branch_ID in the results of step 1 along with the summation of amount of the corresponding rows to each value
Output (English): SELECT Sum ( T2.amount ) , T2.branch_ID FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.branch_ID