Example of doing transactions How to do a transaction with MyISAM tables: mysql> LOCK TABLES trans READ, customer WRITE; mysql> select sum(value) from trans where customer_id=some_id; mysql> update customer set total_value=sum_from_previous_statement where customer_id=some_id; mysql> UNLOCK TABLES; How to do a transaction with Berkeley DB tables: mysql> BEGIN WORK; mysql> select sum(value) from trans where customer_id=some_id; mysql> update customer set total_value=sum_from_previous_statement where customer_id=some_id; mysql> COMMIT; Note that you can often avoid transactions altogether by doing: UPDATE customer SET value=value+new_value WHERE customer_id=some_id;-- From http://www.mysql.com/information/presentations/presentation-oscon2000-20000719/index.html