Courseiva
hardMultiple ChoiceObjective-mapped

FC0-U71 Practice Question: A small business uses a MySQL database to manage…

A small business uses a MySQL database to manage inventory and sales. The database has two tables: Products (ProductID, ProductName, QuantityInStock) and Sales (SaleID, ProductID, QuantitySold, SaleDate). The business runs a nightly script that updates QuantityInStock by subtracting QuantitySold from the Products table based on the day's sales. Recently, the inventory levels have become inaccurate. For example, a product shows negative stock even though no sales occurred that day. The database administrator suspects the issue is related to how transactions are handled. The nightly script runs multiple UPDATE statements in a loop. If the script fails partway through, some products' stock is updated while others are not, leaving inconsistent data. The administrator wants to ensure that either all updates succeed or none do, and that the script does not interfere with daytime operations. Which action should the administrator take?

⚠ Common exam trap

Test-takers frequently think error logging (Option C) or batching (Option B) is sufficient to maintain consistency, but they overlook that without a transaction with rollback, partial updates are still committed and cannot be undone.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Wrap all UPDATE statements in a single transaction with READ COMMITTED isolation level and add error handling to roll back on failure

Wrapping all UPDATE statements in a single transaction with READ COMMITTED isolation level ensures atomicity: either all updates commit or none do, preventing partial updates. Adding error handling with a rollback on failure guarantees that if the script fails partway through, the entire transaction is undone, leaving the database consistent. READ COMMITTED isolation prevents dirty reads and minimizes locking, reducing interference with daytime operations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a stored procedure that updates all products in one statement without error handling

    Why it's wrong here

    Without error handling, a failure could still leave partial updates; a stored procedure alone does not guarantee atomicity without transaction control.

  • Increase the frequency of the script to run every hour with smaller batches

    Why it's wrong here

    Running more frequently does not solve the partial update problem; it may increase contention.

  • Remove the transaction and use individual UPDATE statements with error logging

    Why it's wrong here

    Without a transaction, partial updates can still occur, leading to inconsistency.

  • Wrap all UPDATE statements in a single transaction with READ COMMITTED isolation level and add error handling to roll back on failure

    Why this is correct

    This ensures atomicity (all or nothing) and prevents interference from other transactions.

About these practice questions

This FC0-U71 question is part of Courseiva's 988-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.