Recall & Review
beginner
What does the SET expression do in DynamoDB UpdateItem?
The SET expression updates existing attributes or adds new attributes to an item in DynamoDB.
Click to reveal answer
beginner
How do you add a new attribute using a SET expression?
Use SET with the attribute name and value. If the attribute doesn't exist, DynamoDB creates it with the given value.
Click to reveal answer
intermediate
Can SET expression change multiple attributes at once?
Yes, you can separate multiple attribute updates with commas in a single SET expression.
Click to reveal answer
intermediate
Example: How to increment a numeric attribute 'count' by 1 using SET?
Use: SET count = count + :incr where :incr is 1 in ExpressionAttributeValues.
Click to reveal answer
beginner
What happens if you use SET on an attribute that already exists?
The existing attribute value is replaced with the new value specified in the SET expression.
Click to reveal answer
What does the SET expression do in DynamoDB UpdateItem?
✗ Incorrect
SET expression is used to add or update attributes in an existing item.
How do you update multiple attributes in one SET expression?
✗ Incorrect
Multiple attributes can be updated by separating them with commas in a single SET expression.
What happens if you SET an attribute that does not exist?
✗ Incorrect
If the attribute does not exist, SET creates it with the specified value.
How to increment a numeric attribute 'score' by 5 using SET?
✗ Incorrect
You increment by setting score = score + :val where :val is 5.
Can SET expression be used to change string attributes?
✗ Incorrect
SET can update string attributes by replacing their values.
Explain how the SET expression works for adding or changing attributes in DynamoDB.
Think about how you change or add info in a notebook.
You got /4 concepts.
Describe how to increment a numeric attribute using SET expression in DynamoDB.
Like adding points to a score.
You got /3 concepts.