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?)
