0
0
DynamoDBquery~10 mins

ADD expression for numeric increment in DynamoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to increment the attribute 'count' by 1 using the ADD expression.

DynamoDB
UpdateExpression='ADD count [1]'
Drag options to blanks, or click blank then click option'
A'1'
B:one
Cplus 1
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the number, which makes it a string.
Using a placeholder like ':one' without defining it.
2fill in blank
medium

Complete the code to increment the attribute 'score' by the value of the variable ':inc' using the ADD expression.

DynamoDB
UpdateExpression='ADD score [1]'
Drag options to blanks, or click blank then click option'
A5
B:inc
C'inc'
Dinc
Attempts:
3 left
💡 Hint
Common Mistakes
Using the variable name without colon.
Using quotes around the placeholder.
3fill in blank
hard

Fix the error in the UpdateExpression to correctly increment 'visits' by 2.

DynamoDB
UpdateExpression='ADD visits [1]'
Drag options to blanks, or click blank then click option'
A'2'
Btwo
C2
D:two
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string '2' instead of number 2.
Using an undefined placeholder.
4fill in blank
hard

Fill both blanks to increment 'likes' by the placeholder value and define the placeholder in ExpressionAttributeValues.

DynamoDB
UpdateExpression='ADD likes [1]'
ExpressionAttributeValues={{'[2]': 3}}
Drag options to blanks, or click blank then click option'
A:inc
B:val
C:likes
D:num
Attempts:
3 left
💡 Hint
Common Mistakes
Using different placeholder names in UpdateExpression and ExpressionAttributeValues.
Forgetting the colon ':' in placeholder names.
5fill in blank
hard

Fill all three blanks to increment 'points' by a variable, define the placeholder, and use the correct attribute name.

DynamoDB
UpdateExpression='ADD [1] [2]'
ExpressionAttributeValues={{'[3]': 10}}
Drag options to blanks, or click blank then click option'
Apoints
B:pts
C:points
Dscore
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different attribute name than 'points'.
Mismatch between placeholder in expression and attribute values.