Explain the steps executed during a typical transaction.- A transaction contains one or more SQL statements.
- It is an atomic unit.
- It begins with the first executable SQL statement.
- It ends when it is committed or rolled back.
- The effects of all the SQL statements in a transaction can be either all committed or all rolled back.
- A SQL statement that runs successfully is different from a committed transaction.
Executing successfully means that a single statement was:
2. Found to be a valid SQL construction.
3. Run without error as an atomic unit. For example, all rows of a multirow update are changed.
- However, until the transaction that contains the statement is committed, the transaction can be rolled back, and all of the changes of the statement can be undone.
- A statement, rather than a transaction, runs successfully.