Courseiva

DA0-002 Data Acquisition and Preparation Practice Question

A data analyst is merging two datasets: one containing customer demographics with a 'customer_id' column, and another containing transaction records with a 'cust_id' column. The analyst needs to combine these datasets to analyze purchasing behavior by demographic. Which SQL join condition should be used?

⚠ Common exam trap

The trap here is assuming that column names must match exactly for a join, when in fact they can differ as long as the data values correspond.

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

✓

ON demographics.customer_id = transactions.cust_id

The correct join condition matches the customer identifier from the demographics table with the corresponding identifier in the transactions table, despite the different column names. This allows the analyst to combine the datasets accurately. Using the wrong column names or adding non-existent conditions would result in SQL errors and prevent the merge, so it is essential to map the keys correctly.

Answer analysis

Option-by-option breakdown

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

  • ✗

    ON demographics.customer_id = transactions.cust_id AND demographics.customer_id = transactions.customer_id

    Why it's wrong here

    This condition includes an additional clause that references 'transactions.customer_id', which does not exist. The AND operator requires both conditions to be true, but since one column is missing, the query will fail. The extra condition is unnecessary and causes an error, making this option invalid.

  • ✗

    ON demographics.cust_id = transactions.customer_id

    Why it's wrong here

    The demographics table does not have a 'cust_id' column; it has 'customer_id'. Similarly, the transactions table does not have a 'customer_id' column. This condition references non-existent columns in both tables, leading to an error and preventing the join from executing.

  • ✓

    ON demographics.customer_id = transactions.cust_id

    Why this is correct

    This condition correctly matches the 'customer_id' from the demographics table with the 'cust_id' from the transactions table. Despite different column names, they represent the same entity. Using this join condition ensures that each customer's demographic data is linked to their transactions, enabling accurate analysis of purchasing behavior by demographic.

  • ✗

    ON demographics.customer_id = transactions.customer_id

    Why it's wrong here

    The transactions table does not have a 'customer_id' column; it has 'cust_id'. This join condition would result in an error because the column 'customer_id' does not exist in the transactions table. Therefore, it cannot be used to merge the datasets and would fail to produce the desired analysis.

About these practice questions

Courseiva writes every DA0-002 question from scratch — 1,004 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.