0
0
DynamoDBquery~10 mins

Multiple actions in one update 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 update an attribute named 'status' to 'active' in DynamoDB.

DynamoDB
UpdateExpression='SET status = [1]'
Drag options to blanks, or click blank then click option'
A'active'
Bactive
C"active"
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string values causes syntax errors.
Using double quotes instead of single quotes in UpdateExpression.
2fill in blank
medium

Complete the code to increment the 'count' attribute by 1 using DynamoDB UpdateExpression.

DynamoDB
UpdateExpression='SET count = count [1] :inc'
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' decreases the value instead of increasing.
Using '*' or '/' causes unexpected results.
3fill in blank
hard

Fix the error in the UpdateExpression to remove the attribute 'obsolete'.

DynamoDB
UpdateExpression='REMOVE [1]'
Drag options to blanks, or click blank then click option'
A#obsolete
B'obsolete'
C:obsolete
Dobsolete
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes or placeholders causes syntax errors.
Confusing attribute names with expression attribute names.
4fill in blank
hard

Fill both blanks to set 'score' to 100 and remove 'temp' attribute in one update.

DynamoDB
UpdateExpression='SET [1] = :val REMOVE [2]'
Drag options to blanks, or click blank then click option'
Ascore
Btemp
Cscore_val
Dtemp_val
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the attributes between SET and REMOVE.
Using invalid attribute names.
5fill in blank
hard

Fill all three blanks to add 5 to 'points', set 'level' to 3, and remove 'expired' attribute.

DynamoDB
UpdateExpression='SET [1] = [1] [2] :inc, [3] = :lvl REMOVE expired'
Drag options to blanks, or click blank then click option'
Apoints
B+
Clevel
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' instead of '+' for increment.
Mixing attribute names in wrong blanks.