中文网站
  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.3 Database Systems: Updating

1. Updating allows us to change some values in a tuple without necessarily changing all.We use the update operator,  with the form

ï¿¡A E(r)

where r is a relation with attribute A, which is assigned the value of expression E.
The expression E is any arithmetic expression involving constants and attributes in relation r.

Some examples:

1. To increase all balances by 5 percent.

ï¿¡balance balance ←1*05(deposit)

This statement is applied to every tuple in deposit.

2. To make two di erent rates of interest payment, depending on balance amount:

ï¿¡balance balance ←1*06( ∑balance > 10000(deposit))
ï¿¡balance balance ←1*05( ∑balance ≤ 10000(deposit))
Note: in this example the order of the two operations is important. (Why?)

Database System Structure: