exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 395 discussion

A developer creates an Amazon DynamoDB table. The table has OrderID as the partition key and NumberOfItemsPurchased as the sort key. The data type of the partition key and the sort key is Number.

When the developer queries the table, the results are sorted by NumberOfItemsPurchased in ascending order. The developer needs the query results to be sorted by NumberOfItemsPurchased in descending order.

Which solution will meet this requirement?

  • A. Create a local secondary index (LSI) on the NumberOfItemsPurchased sort key.
  • B. Change the sort key from NumberOfItemsPurchased to NumberOfItemsPurchasedDescending.
  • C. In the Query operation, set the ScanIndexForward parameter to false.
  • D. In the Query operation, set the KeyConditionExpression parameter to false.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
albert_kuo
9 months, 1 week ago
Selected Answer: C
import boto3 dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('YourTableName') response = table.query( KeyConditionExpression=boto3.dynamodb.conditions.Key('OrderID').eq(123), ScanIndexForward=False # decending ) items = response['Items'] for item in items: print(item)
upvoted 1 times
...
ahadh7621
9 months, 2 weeks ago
Selected Answer: C
This question was on my exam, July 23rd, 2024. Answer is C.
upvoted 2 times
...
komorebi
9 months, 3 weeks ago
C. In the Query operation, set the ScanIndexForward parameter to false.
upvoted 1 times
...
rdiaz
9 months, 3 weeks ago
Selected Answer: C
This approach directly addresses the requirement without the need for creating additional indexes or modifying the table schema. It leverages the existing sorting capabilities of DynamoDB and provides a straightforward solution.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago