nerdexam
Amazon

DVA-C02 · Question #483

A developer is creating an application that uses an Amazon DynamoDB table. The developer needs to develop code that reads all records that were added to the table during the previous day, creates HTML

The correct answer is A. Query. The Query operation uses a defined key condition (such as a date-based index) to retrieve only the relevant items, consuming far less read capacity than a full table Scan.

Submitted by suresh_in· Mar 5, 2026Development with AWS Services

Question

A developer is creating an application that uses an Amazon DynamoDB table. The developer needs to develop code that reads all records that were added to the table during the previous day, creates HTML reports, and pushes the reports into third-party storage. The item size varies from 1 KB to 4 KB, and the index structure is defined with the date. The developer needs to minimize the read capacity that the application requires from the DynamoDB table. Which DynamoDB API operation should the developer use in the code to meet these requirements?

Options

  • AQuery
  • BScan
  • CBatchGetItem
  • DGetItem

How the community answered

(26 responses)
  • A
    81% (21)
  • B
    4% (1)
  • C
    4% (1)
  • D
    12% (3)

Why each option

The Query operation uses a defined key condition (such as a date-based index) to retrieve only the relevant items, consuming far less read capacity than a full table Scan.

AQueryCorrect

Query reads only the items that match the specified partition key value and optional sort key condition against the defined index, meaning only the items from the previous day are read; this is the most read-capacity-efficient operation when the access pattern aligns with the index structure.

BScan

Scan reads every item in the table and then filters results, consuming read capacity for all items regardless of whether they match the date filter, making it the most expensive option.

CBatchGetItem

BatchGetItem retrieves specific items by their primary keys but requires knowing the exact keys of each item in advance, which is not practical when retrieving all records from a date range.

DGetItem

GetItem retrieves a single item by its primary key and is not suitable for retrieving a collection of records matching a date-based query.

Concept tested: DynamoDB Query vs Scan read capacity efficiency

Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice