Consider a banking database with three labels and primary key underlined as given below:
Customer (CustomerID , CustomerName, Address, Phone, Email)
Borrows (CustomerID, LoanNumber )
Loan ( LoanNumber , LoanType, Amount )
Write both relational algebra and SQL queries:
- To display name of all customers who live in “Lalitpur” in ascending order of name.
- To count total number of customers having loan at the bank.
- To find name of those customers who have loan amount greater than or equal to 500000.
- To find average loan amount of each accoun’t type.