Task: Text to Code
Input (English): Step 1: find rows in customer table whose credit_score less than 50.
Step 2: find each value of acc_type in the results of step 1 along with the  no_of_loans of the corresponding rows to each value
Output (English): SELECT acc_type , Avg ( no_of_loans ) FROM customer WHERE credit_score < 50 GROUP BY acc_type