See a "real" example of transactions: putting multiple database commands into a script and wrapping them in a transaction.