Example RA
Example RA
Find the loan number for each loan of an amount greater than
$1200"
Find the names of all customers who have a loan, an account, or both,
from the bank"
∏customer_name (σbranch_name=“Perryridge"”
(σborrower.loan_number = loan.loan_number(borrower x loan)))"
Query 1
Query 2"
∏customer_name(σloan.loan_number = borrower.loan_number (
(σbranch_name = “Perryridge” (loan)) x borrower))"
Find the largest account balance"
Strategy:"
Find those balances that are not the largest"
– Rename account relation as d so that we can compare each
account balance with all others"
Use set difference to find those account balances that were not found
in the earlier step. "
The query is:"
∏balance(account) - ∏account.balance"
(σaccount.balance < d.balance (account x ρd (account)))"
Find the names of all customers who have a loan and an account at
bank."
Find the name of all customers who have a loan at the bank and the
loan amount"