Courseiva
Data Store Management →mediumMultiple Choice

DEA-C01 Data Store Management Practice Question

Network Topology
aws dynamodb describe-tabletable-name OrdersRefer to the exhibit."Table": {"AttributeDefinitions": ["AttributeName": "OrderID","AttributeType": "S"},"AttributeName": "CustomerID",],"KeySchema": ["KeyType": "HASH""KeyType": "RANGE""TableStatus": "ACTIVE","ProvisionedThroughput": {"ReadCapacityUnits": 5,"WriteCapacityUnits": 5"TableSizeBytes": 1048576,"ItemCount": 1000

A data engineer runs the above CLI command to describe the DynamoDB table 'Orders'. The table has a partition key 'OrderID' and sort key 'CustomerID'. Which query operation is most efficient for retrieving all orders for a specific customer?

⚠ Common exam trap

Many exam-takers assume the sort key can be used as a query filter without an index, but DynamoDB requires the partition key for Query operations, and a Scan is often mistakenly chosen as a simpler alternative despite its performance cost.

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

✓

Create a Global Secondary Index on CustomerID and query the index

A Global Secondary Index (GSI) on CustomerID allows you to query efficiently using CustomerID as the partition key, avoiding a full table scan. Since the base table's primary key is (OrderID, CustomerID), you cannot directly query by CustomerID alone; a GSI provides an alternative access pattern optimized for this query.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Query the table using CustomerID as the partition key

    Why it's wrong here

    CustomerID is the sort key, not the partition key, so it cannot be supplied as the partition key in a Query; DynamoDB requires the partition key value to route to a single partition. Query with CustomerID as partition key would be right only if the table's key schema were inverted.

  • ✗

    Scan the table and filter by CustomerID

    Why it's wrong here

    Scan reads every item in the table and applies the filter afterwards, consuming read capacity proportional to table size rather than matching items. Scan suits full-table exports or analytics without a known key; retrieving one customer's orders needs a key-based access path instead.

  • ✗

    Use GetItem with CustomerID as the key

    Why it's wrong here

    GetItem requires the complete primary key — both OrderID and CustomerID — and returns at most one item, so it cannot return all orders for a customer. It is the right call when fetching a single known order by its full key.

  • ✓

    Create a Global Secondary Index on CustomerID and query the index

    Why this is correct

    Queries must target the partition key, so retrieving orders by CustomerID needs a Global Secondary Index with CustomerID as its partition key. A Scan reads the whole table; a Query on OrderID cannot filter efficiently by customer.

About these practice questions

One of 1,321 original DEA-C01 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 DEA-C01 practice question is part of Courseiva's free Amazon Web Services 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 DEA-C01 exam.