中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

3.6.1 Database Systems: Deletion

1. Deletion is expressed in much the same way as a query. Instead of displaying, the selected tuples are removed from the database. We can only delete whole tuples.

In relational algebra, a deletion is of the form

r  r _E
where r is a relation and E is a relational algebra query. Tuples in r for which E is true are deleted.

2. Some examples:

1. Delete all of Smith's account records.

deposit deposit cname="Smith"(deposit)

2. Delete all loans with loan numbers between 1300 and 1500.

depositdeposit_loan#≥1300∧loan#≤1500(deposit)

3. Delete all accounts at Branches located in Needham.

r1city="Needham"(deposit∝branch)
r2bname,account#,cname,balance(r1)
deposit deposit_r2

Database System Structure: