Courseiva

DA0-002 Data Acquisition and Preparation Practice Question

Exhibit

Refer to the exhibit.
ERROR: Data type mismatch for column 'transaction_amount' at row 342. Expected DECIMAL(10,2), received VARCHAR.
The source system sends transaction_amount as a string with a currency symbol (e.g., '$123.45').

A data pipeline log shows the above error. Which data transformation should be applied during acquisition?

⚠ Common exam trap

Watch out — candidates often assume CAST in SQL can handle any string-to-number conversion, but CAST strictly requires a valid numeric string and will throw an error for non-numeric characters, making preprocessing essential.

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

✓

Preprocess the string to remove non-numeric characters, then convert to DECIMAL

The error indicates that the pipeline encountered a string with non-numeric characters (e.g., '$1,234.56') when trying to load it into a DECIMAL column. Preprocessing the string to remove non-numeric characters (like currency symbols, commas) before conversion ensures the data is clean and parseable, which is a standard data transformation during acquisition to handle dirty source data.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Skip rows that cause errors

    Why it's wrong here

    Skipping erroring rows discards valid transaction data rather than resolving the type mismatch the log reports, so the pipeline silently loses records. It is tempting as a quick way to unblock ingestion, and would suit genuinely malformed source rows where no correct value can be recovered.

  • ✓

    Preprocess the string to remove non-numeric characters, then convert to DECIMAL

    Why this is correct

    Removing non-numeric characters before casting satisfies the acquisition-stage requirement to cleanse malformed values. DECIMAL conversion then preserves precision for monetary figures, unlike FLOAT. This preprocessing step prevents the cast failure recorded in the pipeline log, ensuring the transformation occurs before data lands in the target store.

  • ✗

    Use CAST(transaction_amount AS DECIMAL(10,2)) in SQL

    Why it's wrong here

    Casting to DECIMAL(10,2) forces a fixed scale and precision, which truncates or overflows values the stem's error concerns, and it cannot convert non-numeric text. It is tempting because explicit casting is the standard remedy for implicit-conversion failures, and would be correct where the target column genuinely requires that exact numeric type.

  • ✗

    Change the target column type to VARCHAR

    Why it's wrong here

    Casting the target column to VARCHAR masks the underlying type mismatch rather than resolving it, and can corrupt or truncate values during acquisition. It is tempting because widening to a string type often silences load errors quickly, which would be acceptable for genuinely textual fields.

About these practice questions

One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 DA0-002 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 DA0-002 exam.