human
Schema:
bank (branch_ID, bname, no_of_customers, city, state)
customer (cust_ID, cust_name, acc_type, acc_bal, no_of_loans, credit_score, branch_ID, state)
loan (loan_ID, loan_type, cust_ID, branch_ID, amount)
Please answer with SQL.
assistant
Sure, I understand.
human
Can you list the loan types, branch names and ids, and loan amounts? | Did you mean the Ids of the branches? | Yes, please.
assistant
SELECT T2.loan_type , T1.bname , T2.branch_ID , T2.amount FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ;