Because of the above three properties, transactions are an ideal way of structuring
interaction with a database. This leads us to impose a requirement on
transactions themselves. A transaction must preserve database consistency—if a
transaction is run atomically in isolation starting from a consistent database, the
database must again be consistent at the end of the transaction. This consistency
requirement goes beyond the data integrity constraintswe have seen earlier (such
as primary-key constraints, referential integrity, check constraints, and the like).
Rather, transactions are expected to go beyond that to ensure preservation of those
application-dependent consistency constraints that are too complex to state using
the SQL constructs for data integrity. How this is done is the responsibility of the
programmerwho codes a transaction. This property is referred to as consistency.