0
0
DynamoDBquery~10 mins

SET expression for adding/changing 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 set the attribute 'age' to 30 in the DynamoDB update expression.

DynamoDB
UpdateExpression = "SET age = [1]"
Drag options to blanks, or click blank then click option'
A30
B"30"
Cage + 1
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers, which makes them strings.
Trying to increment with SET instead of ADD.
2fill in blank
medium

Complete the code to add 5 to the existing 'score' attribute using SET expression.

DynamoDB
UpdateExpression = "SET score = score [1] :increment"
Drag options to blanks, or click blank then click option'
A+
B*
C-
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' which subtracts instead of adds.
Using '*' or '/' which multiply or divide.
3fill in blank
hard

Fix the error in the SET expression to update the 'count' attribute by adding 1.

DynamoDB
UpdateExpression = "SET count = count [1] 1"
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' which decreases the value.
Using '*' or '/' which change the value incorrectly.
4fill in blank
hard

Fill both blanks to set 'status' to 'active' and increment 'visits' by 1.

DynamoDB
UpdateExpression = "SET status = [1], visits = visits [2] :inc"
Drag options to blanks, or click blank then click option'
A:active
B+
C-
D"active"
Attempts:
3 left
💡 Hint
Common Mistakes
Using direct string without placeholder.
Using '-' to decrement visits.
5fill in blank
hard

Fill all three blanks to set 'level' to 5, 'active' to true, and increase 'points' by 10.

DynamoDB
UpdateExpression = "SET level = [1], active = [2], points = points [3] :pts"
Drag options to blanks, or click blank then click option'
A5
Btrue
C+
D"true"
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around booleans.
Using '-' instead of '+' for points.