2,303 views
0 votes
0 votes
Consider the bank database. Give an expression in the relational
algebra for each of the following queries:
a. Find all loan numbers with a loan value greater than $10,000.
b. Find the names of all depositors who have an account with a value
greater than $6,000.
c. Find the names of all depositors who have an account with a value
greater than $6,000 at the “Uptown” branch.

branch(branch name, branch city, assets)
customer (customer name, customer street, customer city)
loan (loan number, branch name, amount)
borrower (customer name, loan number)
account (account number, branch name, balance)
depositor (customer name, account number)

2 Answers

0 votes
0 votes
Answer for a :

select loan number from loan where amount > 10000;

Answer for b:
select customer name from depositor as d join account as a on d.account number = a.account number and a.balance > 6000;

Answer for c:

select customer name from depositor as d join account as a on d.account number = a.account number and a.balance > 6000 and a.branch name = "Uptown";
0 votes
0 votes

1 . Project (loan number) Select (amount > 10,000) (Loan)\

2. Project (customer name) Select(balance > 6,000) (Account (account.account number = depositor.account number) Depositor)

3. Project (customer name) Select(balance > 6,000) (Account (account.account number = depositor.account number & account.branch name = Uptown) Depositor)

Related questions