Courseiva
Data Concepts and EnvironmentshardMultiple ChoiceObjective-mapped

DA0-002 Data Concepts and Environments Practice Question

Exhibit

CREATE TABLE Orders (
  OrderID INT PRIMARY KEY,
  CustomerID INT,
  OrderDate DATE,
  TotalAmount DECIMAL(10,2),
  INDEX idx_cust (CustomerID),
  INDEX idx_date (OrderDate)
);

Refer to the exhibit. A database administrator notices that queries filtering on both CustomerID and OrderDate are slow. Which single change would most likely improve performance for such queries?

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

Add a composite index on (CustomerID, OrderDate)

A composite index on (CustomerID, OrderDate) allows the database to use a single index to filter on both columns, which is more efficient than using separate indexes and combining results.

Answer analysis

Option-by-option breakdown

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

  • Partition the table by OrderDate

    Why it's wrong here

    Partitioning can help range scans, but for equality filters on both columns, a composite index is typically better.

  • Convert TotalAmount to VARCHAR

    Why it's wrong here

    Changing data type would not help query performance and could cause data issues.

  • Add a composite index on (CustomerID, OrderDate)

    Why this is correct

    A composite index can satisfy both conditions in one index seek.

  • Remove the primary key constraint

    Why it's wrong here

    Removing the primary key would hurt performance and data integrity.

About these practice questions

One of 986 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.