Updates



next up previous
Next: Null Values Up: Modifying the Database Previous: Insertion

Updates

  1. Updating allows us to change some values in a tuple without necessarily changing all.
  2. 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?)

  3. In general, where clause of update statement may contain any construct legal in a where clause of a select statement (including nesting).
  4. As before, any select embedded must not reference the relation being updated.

    For example, the following is an ambiguous request:

    The result would depend on the order in which tuples are processed.



Page created and maintained by Osmar R. Zaï ane
Last Update: Mon Oct 16 16:41:58 PDT 1995