Database Management System2080.110 marksComplex Retrieval Queries
Consider a banking database with three tables 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: a. To display name of all customers who
Consider a banking database with three tables 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: a. To display name of all customers who live in “Lalitpur” in ascending order of name. b. To count total number of customers having loan at the bank. c. To find name of those customers who have loan amount greater than or equal to 500000. d. To find average loan amount of each account type.[10]
- Customer(<uCustomerID</u, CustomerName, Address, Phone, Email) - Borrows(<uCustomerID</u, <uLoanNumber</u) - Loan(<uLoanNumber</u, LoanType, Amount) --- $$\tau{CustomerName}(\pi{CustomerName}(\sigma{Address='Lalitpur'}(Customer)))$$ Where: - $\sigma$ = Selection operator (filters rows) - $\pi$ ...