exam questions

Exam AWS Certified Developer Associate All Questions

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

Exam AWS Certified Developer Associate topic 1 question 100 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 100
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company has an online order website that uses Amazon DynamoDB to store item inventory. A sample of the inventory object is as follows:

A developer needs to reduce all inventory prices by 100 as long as the resulting price would not be less than 500.
What should the developer do to make this change with the LEAST number of calls to DynamoDB?

  • A. Perform a DynamoDB Query operation with the Id. If the price is >= 600, perform an UpdateItem operation to update the price.
  • B. Perform a DynamoDB UpdateItem operation with a condition expression of "Price >= 600".
  • C. Perform a DynamoDB UpdateItem operation with a condition expression of "ProductCategory IN ({"S": "Sporting Goods"}) and Price 600".
  • D. Perform a DynamoDB UpdateItem operation with a condition expression of "MIN Price = 500".
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
JonasKahnwald
4 months, 1 week ago
Selected Answer: B
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html#Expressions.ConditionExpressions.SimpleComparisons
upvoted 1 times
...
sumanshu
4 months, 1 week ago
Selected Answer: B
DynamoDB will only execute the update when the price is at least 600. It reduces the price by 100 in a single call.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: B
Of course B,we have to update the Price with the value (Price - 100) whenever price >= 600
upvoted 1 times
...
gaddour_med
2 years, 2 months ago
WHY consition is not Price >500 it can be 550
upvoted 2 times
JonasKahnwald
5 months, 2 weeks ago
Because you are checking the price BEFORE performing the update.
upvoted 1 times
...
...
sichilam
2 years, 3 months ago
B is correct aws dynamodb update-item \ --table-name ProductCatalog \ --key '{"Id": {"N": "456"}}' \ --update-expression "SET Price = Price - :discount" \ --condition-expression "Price > :limit" \ --expression-attribute-values file://values.json
upvoted 1 times
...
thensanity
2 years, 3 months ago
all - keyword, you do not need to specify which id needs to be updated
upvoted 2 times
...
gpit
2 years, 4 months ago
Selected Answer: B
It'd be even better if B is in an index.
upvoted 1 times
...
dark_cherrymon
2 years, 5 months ago
Selected Answer: B
it's not A because you don't need to query by ID
upvoted 1 times
...
habros
2 years, 6 months ago
Selected Answer: B
B is answer
upvoted 1 times
...
haazybanj
2 years, 6 months ago
Selected Answer: B
B is the answer
upvoted 1 times
...
szhang2004
2 years, 7 months ago
should be B
upvoted 1 times
...
Vinafec
2 years, 7 months ago
Selected Answer: B
Easy B
upvoted 1 times
...
Danbraga
2 years, 7 months ago
Selected Answer: B
I vote for B, acording to this doc: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html
upvoted 4 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