Aranas 03-Hands-On Activity 2
Aranas 03-Hands-On Activity 2
BSIT- 501
1. Create a database name Currency Control and create a two (2) tables name
Accounts and Transac_History and put the following data.
BEGIN TRANSACTION;
ROLLBACK TRANSACTION;
OUTPUT 1
OUTPUT 2
3. On August 28, 2020, the database administrator creates a new transaction on the Accounts
table. Still, he wants to obtain a lock that will prevent any other transaction from modifying
any rows from it while he was working with his transaction. But he wants other transactions to
be able to insert new entries. Meanwhile, an application programmer inserts a new entry in
Accounts table: T_ID: 6, Name: Clint, Balance: ₱19,000. At the same time, a sophisticated user
wants to modify the balance of Thor by deducting a ₱500. Using the REPEATABLE READ
command, write queries that will demonstrate these three (3) concurrent transaction.
Step 1: Database Administrator Starts the Transaction
Output 2
Output 3
Output 4
4. On the same day, the database administrator creates a new transaction again by adding up
a ₱1000 balance to all rows in the Accounts table. This time, he wants his transaction to
obtain an exclusive lock. While the database administrator is working with his transaction, a
sophisticated user named Joe wants to add a new entry: T_ID: 7, Name: Natasha, Balance:
₱9,000. Using SERIALIZABLE command, write queries that will demonstrate these two (2)
concurrent transactions.
(Note: You can use while loop in order to update all the rows with a specific value.)
COMMIT;
Output 1
Output 2