银行场景的关系代数
Deposit (Branch, Acc-No, Cust-Name, Balance) Loan (Branch, Loan-No, Cust-Name, Balance) Branch (Branch, Assets, Branch-County) Customer (Cust-Name, Cust-County, Branch)
生成一个关系,显示贷款大于GB 2500.00的所有客户和所有存款账户余额小于GB 100.00的客户的分支机构、客户名称、余额和帐户号。所有的顾客都应该在隆福分店。
π Branch, Acc-No, Cust-Name, Balance ( σ(Loan.Balance > 2000 ∧ branch='Romford')(Loan) ∪ σ(Deposit.Balance < 150 ∧ branch='Romford')(Customer ∩ Deposit) )
π Branch, Cust-Name, Balance, Acc-No, (σ Balance < 100^branch=”Romford” (Deposit)) ∪ π Branch, Cust-Name, Balance, Loan-No, (σ Balance > 2500 ^branch=”Romford”(Loan))
噜噜哒