Free Practice Quiz Question List

6 Transactions and Concurrency Basics Online Quiz Questions

Use this free practice quiz with 30 questions to review 6 Transactions and Concurrency Basics, test your knowledge, and prepare for your next test or exam.

30 questions
01
Choose one
1 point

A money transfer subtracts funds from one account and adds them to another. Which ACID property ensures that a failure cannot leave only one of those changes recorded?

  1. A

    Consistency

  2. B

    Atomicity

  3. C

    Isolation

  4. D

    Durability

02
Choose one
1 point

A database has a schema constraint that prohibits negative account balances, but the application must also check a separate business rule. Which statement best describes the role of consistency?

  1. A

    Durability guarantees that every possible business rule is automatically enforced.

  2. B

    Consistency preserves defined rules, though some rules may need application logic.

  3. C

    Isolation prevents all concurrent transactions from running at the same time.

  4. D

    Atomicity checks that every transaction updates at least one row.

03
Choose one
1 point

A transaction successfully commits. Which outcome describes durability most accurately?

  1. A

    The transaction's changes are hidden from every other transaction.

  2. B

    The transaction automatically retries if any operation fails.

  3. C

    The committed changes are recorded to survive a system failure, subject to the database's guarantees and configuration.

  4. D

    The transaction preserves only rules enforced by application code.

04
Choose one
1 point

Two transactions run at the same time and their reads and writes overlap. Which transaction property governs what each transaction can see from the other's work?

  1. A

    It governs which concurrent changes a transaction can see.

  2. B

    It guarantees that every transaction is committed immediately.

  3. C

    It ensures that application-level business rules are always enforced.

  4. D

    It lets a transaction undo only work performed before a savepoint.

05
Choose one
1 point

An application has finished the intended work in a transaction and wants to keep its changes. Which description correctly distinguishes the relevant control commands?

  1. A

    COMMIT cancels uncommitted changes; ROLLBACK makes them permanent.

  2. B

    Both commands keep the changes, but only ROLLBACK makes them visible.

  3. C

    COMMIT keeps the changes; ROLLBACK cancels uncommitted changes.

  4. D

    Both commands cancel all changes made by earlier transactions.

06
Choose one
1 point

A database client uses autocommit, and an application issues two standalone update statements without explicitly grouping them. What is the usual behavior described in the material?

  1. A

    All statements issued by a client are automatically grouped into one transaction.

  2. B

    Each standalone statement is treated as its own transaction and committed if it succeeds.

  3. C

    A statement is committed only if the application explicitly issues ROLLBACK.

  4. D

    Autocommit prevents transactions from using more than one statement.

07
Choose one
1 point

An application must ensure that two related updates are kept together rather than committed separately. Which approach best meets that requirement?

  1. A

    Issue ROLLBACK after each update so both changes are committed together.

  2. B

    Rely on autocommit, because it groups consecutive statements into one transaction.

  3. C

    Use a savepoint without starting a transaction block.

  4. D

    Start a transaction block before the related updates and commit only after both succeed.

08
Choose one
1 point

An application uses a transaction to subtract money from one account and add it to another. Beyond grouping the updates, what should it do to make the operation reliable?

  1. A

    Check that the expected account rows were updated and enforce rules such as sufficient funds.

  2. B

    Assume the updates succeeded because they appear between BEGIN and COMMIT.

  3. C

    Use a stronger isolation level, which automatically checks every business rule.

  4. D

    Replace COMMIT with ROLLBACK after both updates.

09
Choose one
1 point

A transaction has made useful changes, then encounters a problem in later work. What is the effect of rolling back to a savepoint made before that later work?

  1. A

    It commits the entire transaction and removes all earlier work.

  2. B

    It undoes work after the savepoint while keeping earlier work in the transaction.

  3. C

    It makes all work after the savepoint permanent immediately.

  4. D

    It starts a separate transaction that cannot be rolled back.

10
Choose one
1 point

A team considers choosing a stronger isolation level for concurrent work. Which trade-off should it account for?

  1. A

    It can reduce concurrency or cause a transaction to be rejected and require a retry.

  2. B

    It always increases concurrency and prevents transaction failures.

  3. C

    It ensures all application-level business rules are enforced by the database.

  4. D

    It makes every database system implement named isolation levels identically.

11
Choose one
1 point

An application is configured to use READ UNCOMMITTED on PostgreSQL. How does PostgreSQL treat this isolation level according to the material?

  1. A

    PostgreSQL treats it as SERIALIZABLE.

  2. B

    PostgreSQL treats it as REPEATABLE READ.

  3. C

    PostgreSQL treats it as READ COMMITTED.

  4. D

    PostgreSQL rejects it in every configuration.

12
Choose one
1 point

An application runs transactions at PostgreSQL's SERIALIZABLE level. What should it be prepared to do if the database reports a serialization failure?

  1. A

    The transaction is silently committed with all conflicting changes removed.

  2. B

    The database converts the transaction to READ COMMITTED and never reports a failure.

  3. C

    The database retries the transaction automatically in every case.

  4. D

    The application may receive a serialization failure and should be prepared to retry.

13
Choose one
1 point

An engineer assumes that a named isolation level behaves identically across all database systems. Which correction is supported by the material?

  1. A

    A named isolation level always provides precisely the same guarantees in every database.

  2. B

    The exact guarantees and implementation of a named level can vary by database system.

  3. C

    Isolation levels affect only transaction durability, not concurrent visibility.

  4. D

    Every database treats READ UNCOMMITTED as allowing uncommitted changes to be seen.

14
Choose one
1 point

A transaction encounters an error before it commits. Which command should the application use to cancel the transaction’s uncommitted changes?

  1. A

    Issue COMMIT to keep the pending changes.

  2. B

    Issue ROLLBACK to cancel the uncommitted changes.

  3. C

    Issue SAVEPOINT to make the changes permanent.

  4. D

    Issue BEGIN to cancel the transaction.

15
Choose one
1 point

A database must reject any account update that would leave its balance below zero. Which mechanism can enforce this rule at the database level when it is defined in the schema?

  1. A

    A check constraint that prohibits negative balances.

  2. B

    A commit command issued after every update.

  3. C

    A higher isolation level for every transaction.

  4. D

    A savepoint created before each update.

16
Choose one
1 point

Which command starts a transaction block so several database operations can be grouped together?

  1. A

    BEGIN

  2. B

    COMMIT

  3. C

    ROLLBACK

  4. D

    SAVEPOINT

17
Choose one
1 point

After all statements in a transaction have succeeded, which command should be issued to keep its changes and make them visible to other transactions?

  1. A

    BEGIN

  2. B

    ROLLBACK

  3. C

    SAVEPOINT

  4. D

    COMMIT

18
Choose one
1 point

A transaction detects an error before it has committed. Which command cancels its uncommitted changes rather than keeping them?

  1. A

    COMMIT

  2. B

    ROLLBACK

  3. C

    SAVEPOINT

  4. D

    BEGIN

19
Choose one
1 point

A transaction is already in progress, and the application wants to mark a position it may refer to later. Which command creates that marker?

  1. A

    COMMIT

  2. B

    BEGIN

  3. C

    SAVEPOINT

  4. D

    ROLLBACK

20
Choose one
1 point

In broad terms, what behavior does stronger transaction isolation aim to provide for concurrent work?

  1. A

    Each standalone statement is committed as its own transaction.

  2. B

    Committed changes are guaranteed to survive every possible system failure.

  3. C

    All business rules are enforced whether or not they are defined.

  4. D

    Concurrent work behaves more like transactions ran one at a time.

21
Choose one
1 point

Which option is one of the common transaction isolation-level names?

  1. A

    REPEATABLE WRITE

  2. B

    REPEATABLE READ

  3. C

    RETRYABLE READ

  4. D

    READ AGAIN

22
Choose one
1 point

How does PostgreSQL treat the READ UNCOMMITTED isolation level?

  1. A

    It treats READ UNCOMMITTED as READ COMMITTED.

  2. B

    It treats READ UNCOMMITTED as SERIALIZABLE.

  3. C

    It treats READ UNCOMMITTED as REPEATABLE READ.

  4. D

    It rejects READ UNCOMMITTED as an invalid level name.

23
Choose one
1 point

An application uses PostgreSQL SERIALIZABLE isolation. Which outcome should it be prepared to handle?

  1. A

    It silently commits every conflicting transaction.

  2. B

    It guarantees that a transaction can never be rejected.

  3. C

    It can report a serialization failure that the application should be prepared to retry.

  4. D

    It automatically retries every failed transaction without application handling.

24
Choose one
1 point

Which practice helps an application avoid committing a transaction whose important conditions have not been checked?

  1. A

    Validate important conditions before committing.

  2. B

    Assume every operation succeeded without checking its result.

  3. C

    Keep the transaction open as long as possible after its work is done.

  4. D

    Use a savepoint to make uncommitted changes permanent.

25
Choose one
1 point

Which transaction-handling plan best follows the practical guidance for reliable concurrent work?

  1. A

    Keep transactions open until all unrelated application tasks are finished.

  2. B

    Keep transactions focused and reasonably short, validate important conditions before committing, and handle errors appropriately.

  3. C

    Avoid checking important conditions until after commit.

  4. D

    Retry every transaction indefinitely without handling errors.

26
Choose one
1 point

A transaction debits one account, but an error occurs before it credits the other account and before the transaction commits. To prevent a partial transfer, what should the application do?

  1. A

    Keep the debit because it succeeded, then retry only the credit.

  2. B

    Roll back the transaction so neither update takes effect.

  3. C

    Commit the debit and record the missing credit as a separate transaction.

  4. D

    Leave the debit in place because atomicity applies only to reads.

27
Choose one
1 point

In a transaction that transfers funds by updating two account rows, what should the application check in addition to enforcing business rules such as sufficient funds?

  1. A

    Assume each UPDATE changed one row because it ran without an error.

  2. B

    Use COMMIT to verify that both account identifiers exist.

  3. C

    Rely on autocommit to combine the two updates into one transaction.

  4. D

    Check that the expected account rows were updated.

28
Choose one
1 point

Which practice is recommended for managing transaction scope?

  1. A

    Keep transactions open until the application shuts down.

  2. B

    Put unrelated database work into one long transaction.

  3. C

    Keep transactions focused and reasonably short.

  4. D

    Avoid handling transaction errors after they occur.

29
Choose one
1 point

Before committing a transaction that transfers money from an account, which business condition does the example say the application should enforce?

  1. A

    Assume the database checks sufficient funds even if no such rule is defined.

  2. B

    Enforce a business rule such as requiring sufficient funds.

  3. C

    Use durability guarantees to ensure the account has enough money.

  4. D

    Create a savepoint instead of checking the account balance.

30
Choose one
1 point

An application decides to discard all uncommitted changes in the current transaction. Which command should it issue?

  1. A

    ROLLBACK

  2. B

    COMMIT

  3. C

    BEGIN

  4. D

    SAVEPOINT