Consider the following relation schema:
Repayment (borrower_id, name, address, loan_amount,
request_date, repayment_date, repayment_amount)
Schema Description:
? A borrower is identified with a unique borrower_id, and has only one
address.
? Borrowers can have multiple simultaneous loans, but they always have
different request dates.
? The borrower can make multiple repayments on the same day, but not more
than one repayment per loan per day:
A. Write an SQL statement to find the total repaid amount for each loan. (03 Points)
B. Deletes all information of ended loans. Loan is ended if the total of its
repayment_amount equals to loan_amount. (03 Points)
C. Write an SQL statement to find the sum of the loan_amounts for each borrower. (02
points)
D. Write an SQL statement to find the count the number of borrowers who have more
than 2 simultaneous loans. (02 Points)