Updating



next up previous
Next: Views Up: Modifying the Database Previous: Insertions

Updating

  1. Updating allows us to change some values in a tuple without necessarily changing all.

    We use the update operator, , with the form

    where is a relation with attribute , which is assigned the value of expression .

    The expression is any arithmetic expression involving constants and attributes in relation .

    Some examples:

    1. To increase all balances by 5 percent.

    This statement is applied to every tuple in deposit.

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

    Note: in this example the order of the two operations is important. (Why?)



Page created and maintained by Osmar R. Zaï ane
Last Update: Wed Sep 20 15:45:57 PDT 1995