FIT2094 Lecture Notes - Lecture 8: Transaction Processing, Database Transaction, Granularity
W8: SQL!
UPDATE !
ā¢ Change the values of existing data !
ā¢ For example, at the end of semester, change the mark and grade from 0,āNAā to the actual mark !
and grade. !
DELETE !
ā¢ Removing data from the database DELETE FROM table !
[WHERE condition]; !
DELETE FROM enrolment#
WHERE sno=ā112233ā#
AND unit_code= (SELECT unit_code FROM unit WHERE unit_name=āDatabasesā ) AND
semester=ā1ā#
AND year=ā2012ā; !
Transaction Properties !
A transaction is the execution of a program that accesses (read) or changes (write) the contents of
a database system. !
A transaction must have the following properties: ā Atomicity !
ā¢ All database operations (SQL requests) of a transaction must be entirely completed or entirely
aborted !
ā Consistency#
ā¢ It must take the database from one consistent state to another !
ā Isolation !
ā¢It must not interfere with other concurrent transactions !
ā¢Data used during execution of a transaction cannot be used by a second transaction until
the ļ¬rst one is completed #
ā Durability #
ā¢ Once completed the changes the transaction made to the data are durable, even in the event of
system failure !
Transaction Management !
ā¢$Transaction management: The management of multiple transactions submitted
concurrently by various users to the same database system. !
ā¢$Follows the ACID properties. !
ā¢$Transaction boundaries #
ā Start !
ā¢$ļ¬rst SQL statement is executed (eg. Oracle) #
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Update: change the values of existing data, for example, at the end of semester, change the mark and grade from 0,"na" to the actual mark and grade. Delete: removing data from the database delete from table. And unit_code= (select unit_code from unit where unit_name= databases" ) and semester= 1". A transaction is the execution of a program that accesses (read) or changes (write) the contents of a database system. A transaction must have the following properties: atomicity: all database operations (sql requests) of a transaction must be entirely completed or entirely aborted. Consistency: it must take the database from one consistent state to another. It must not interfere with other concurrent transactions. Data used during execution of a transaction cannot be used by a second transaction until the rst one is completed. Durability: once completed the changes the transaction made to the data are durable, even in the event of system failure.