Adbase H1 Midterms Flashcards

1
Q

a collection of operations that form a single logical unit of work.

A

Transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

the equivalent of a single SQL statement in an application program or transaction

A

database request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Satisfies the constraints specified in the schema

A

database consistent state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A DBMS uses this to keep track of all the transactions that update the database.

A

Transaction log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

requires that all operations (SQL request) of a transaction should be completed.

A

Atomacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ensures that only valid data following all rules and constraints will be written in the database.

A

Consistency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

ensures that once transaction changes are done and committed, they cannot be undone or lost.

A

Durability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The data used during the execution of a current transaction cannot be used by another transaction until the first one is completed.

A

Isolation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

if the transaction fails after step 3, and before step 6, the system should ensure that its updates are not reflected in the database, an inconsistency will result.

A

Atomicity requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The sum of Aldous account and Brendon’s account is unchanged by the execution of the transaction.

A

Consistency requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Transactions should be run sequentially. Therefore, no other transaction will happen on both accounts until the current transaction is completed.

A

Isolation requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Once the user has been notified that the transaction has completed( the transfer of the P1000 has taken place), the updates to the database by the transaction must persist despite failures.

A

Durability requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

This marks the beginning of transaction execution.

A

BEGIN TRANSACTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

this signals a successful end of the transaction so that any changes (updates) executed by the transaction can be safely committed to the database and will not be undone.

A

COMMIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

This signals that the transaction has ended unsuccessfully so that any changes or effects that the transaction may have applied to the database must be undone.

A

ROLLBACK TRANSACTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

is a point in a transaction when you can roll the transaction back to a certain point without rolling back the entire transaction.

A

SAVE TRANSACTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

returns the number of BEGIN TRANSACTION statements that have occurred on the current connection.

A

@@TRANCOUNT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

in this state, a transaction stays in this state to perform READ and WRITE operations.

A

Active state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

where the final statement in queries has been executed

A

Partially committed state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

after all the operation has been completed

A

Committed state

21
Q

if one of the operations cannot be done or proceed

A

Failed State

22
Q

corresponds to the transaction leaving the system and if it is either committed or aborted

A

Terminated

23
Q

When several transactions execute simultaneously in the database, there will be a chance that the consistency and integrity of data may no longer be preserved. The system must control the interaction among the concurrent transactions, and this control is achieved through concurrency control techniques.

A
  • Concurrency Control:
24
Q

occurs when two concurrent transactions, T1 and T2, are updating the same data element, and one of the updates is lost (overwritten by the other transaction).

A
  • Lost Update
25
Q

occurs when two transactions, T1 and T2, are executed concurrently, and the first transaction (T1) is rolled back after the second transaction (T2) has already accessed the uncommitted data.

A
  • Uncommitted data
26
Q

occur when a transaction accesses data before and after one or more other transactions finish working with the same data.

A
  • Inconsistent retrievals
27
Q

guarantees exclusive use of data item to a current transaction.
o Transaction T2 does not have access to a data item that is currently being used by transaction T1.
o The lock is released (unlocked) when the transaction is completed.

A

lock

28
Q

o Locks the entire database
o prevents the use of any tables in the database to transaction T2 while transaction T1 is being executed
o Good for batch processes, but not suitable for multiuser DBMS as it would slow down the data access if thousands of transactions had to wait for the current transaction to be completed

A

database-level lock

29
Q

o The entire table is locked.
o Prevents access to any row by transaction T2 while transaction T1 is using the table.
o If a transaction requires access to several tables, each table may be locked.
o Two (2) transactions can access the same database as long as they access different tables.
o Transactions T1 and T2 cannot access the same table even when they try to use different rows.

A

table-level lock

30
Q

o Less restrictive
o Allows concurrent transactions to access different rows of the same table even when the rows are located on the same page
o Improves the availability of data but requires high usage of space because a lock exists for each row in a table of the database

A

row-level lock

31
Q

o Has only two states: locked (1) and unlocked (0).
o If an object such as a database, table, or row is locked by a transaction, no other transaction can use that object.
o As a rule, the transaction must unlock the object after its termination.
o These options are automatically managed by the DBMS.
o User does not require to manually lock or unlock data items.

A

binary lock

32
Q

o An exclusive lock exists when access is reserved specifically for the transaction that locked the object.
o A shared lock exists when a transaction wants to read data from the database, and no exclusive lock has held that data item.
o Using the shared/exclusive locking concept, a lock can have three states: unlocked, shared (read), and exclusive (write).

A

shared/exclusive lock

33
Q

occurs when two (2) transactions wait indefinitely for each other to unlock data.

A

deadlock

34
Q
  • Transaction isolation levels are described by the type of “reads” that a transaction allows or not. The types of read operation are:
A

Transaction Isolation Level

35
Q

a transaction can read data that is not committed yet.

A

Dirty Read

36
Q

The original salary of Mary was ₱15,000. The treasurer changed Mary’s salary to ₱20,000 but did not commit the transaction.

A

Dirty Read

37
Q

Mary read her wages and found an increase in her wages by
₱5,000.

A

Dirty Read

38
Q

The treasurer found out that they had a mistake in the corresponding transaction. The transaction had been rolled back, and Mary’s salary is back to ₱15,000. The ₱20,000 salary is now considered dirty data.

A

Dirty Read

39
Q

a transaction reads a given row at time T1, and then it reads the same row at time T2, yielding different results. The original row may have been updated or deleted.

A

Non-repeatable read

40
Q

In Transaction 1, Mary read her own salary of ₱15,000, and the operation was not completed.

A

Non-repeatable read

41
Q

In Transaction 2, the Treasurer modified Mary’s salary to
₱20,000 and submitted the transaction.

A

Non-repeatable read

42
Q

In Transaction 1, when Mary read her salary again, her salary changed to ₱20,000.

A

Non-repeatable read

43
Q

a transaction executes a query at time T1, and then it runs the same query at time T2, yielding additional rows that satisfy the query.

A

Phantom Read

44
Q

Transaction 1, read all employees with a salary of ₱1000 and return 10 rows.

A

Phantom Read

45
Q

At this point, Transaction 2 inserts an employee record into the employee table with a salary of 1000

A

Phantom Read

46
Q

Transaction 1 read all employees with a salary of ₱1000 again
and return 11 rows.

A

Phantom Read

47
Q

o is the least restrictive isolation level
o it ignores locks placed by other transactions.
o Can read modified data values that have not yet been committed by other transactions; these are called “dirty” reads.

A

READ UNCOMMITTED

48
Q

o A more restrictive isolation level than READ COMMITTED
o Encompasses READ COMMITTED
o Ensures that no other transactions can modify or delete data that has been read by the current transaction until the current transaction commits
o Does not prevent other transactions from inserting new rows into the tables which have been using in the existing transaction, resulting in “phantom reads”

A

REPEATABLE READ

49
Q

o Ensures that the data that one transaction has read, will be prevented from being updated or deleted by any other transaction.

A

SERIALIZABLE isolation