Task: Text to Code
Input (English): Step 1: find the loan's cust_ID of loan table for which loan_type equals Mortgages.
Step 2: find the average credit_score in customer table whose cust_name not one of the results of step 1
Output (English): SELECT Avg ( T1.credit_score ) FROM customer AS T1 WHERE T1.cust_name NOT IN ( SELECT T2.cust_ID FROM loan AS T2 WHERE T2.loan_type = "Mortgages" )