- Year not given
RA: delete loans under 1000
Short answer
Subtract loans with amt < 1000 from Loan using assignment: Loan ← Loan - σ amt < 1000 (Loan).
Consider the relational schema: Acc (a_no, b_name, bal) Branch (b_name, b_city, assets) Customer (c_name, c_street, c_city) Loan (l_no, b_name, amt) Depositor (c_name, a_no) Borrower (c_name, l_no) Delete all loans less than $1000 in amount. (Write a relational algebra expression.)
Relational algebra symbols used: σ select, π project, ⋈ natural join, ∪ union, ∩ intersection, − difference, ρ rename, 𝒢 aggregate.
In relational algebra, deletion is written as an assignment: the relation is replaced by itself minus the tuples to delete.
Relational algebra expression
Loan ← Loan − σ amt < 1000 (Loan)
Explanation
- σ amt < 1000 (Loan) selects every loan below $1000.
- Subtracting these tuples from Loan removes them, and the remaining loans (amt ≥ 1000) are assigned back to Loan.
- The schema (l_no, b_name, amt) is unchanged.
If Borrower still refers to a deleted loan, those tuples should also be removed to keep referential integrity. This step must run before the Loan deletion above, because it needs the old Loan tuples to find the small loans:
Borrower ← Borrower − π c_name, l_no ( Borrower ⋈ σ amt < 1000 (Loan) )
Equivalent SQL
DELETE FROM Loan WHERE amt < 1000;
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- RA: increase loans over 10000 · Database Management System, chapter 3
- SQL: branch city with assets over 1000000 · Database Management System, chapter 3
- RA: count accounts in each branch · Database Management System, chapter 3
- SQL: customer name and address · Database Management System, chapter 3
- SQL: customer, branch, account details · Database Management System, chapter 3
- SQL: create tables for bank schema · Database Management System, chapter 3
- SQL: customer names beginning with su · Database Management System, chapter 3