0
0
DynamoDBquery~10 mins

Why update expressions modify attributes in DynamoDB - Test Your Understanding

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

Complete the code to update the attribute 'Age' to 30 in DynamoDB.

DynamoDB
UpdateExpression='SET Age = [1]'
Drag options to blanks, or click blank then click option'
A30
BAge
C'Age'
D30+1
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute name instead of value
Adding quotes around numbers incorrectly
2fill in blank
medium

Complete the code to increment the attribute 'Score' by 5 using an update expression.

DynamoDB
UpdateExpression='SET Score = Score [1] 5'
Drag options to blanks, or click blank then click option'
A/
B-
C*
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication instead of addition
3fill in blank
hard

Fix the error in the update expression to remove the attribute 'Status'.

DynamoDB
UpdateExpression='[1] Status'
Drag options to blanks, or click blank then click option'
AREMOVE
BDELETE
CSET
DADD
Attempts:
3 left
💡 Hint
Common Mistakes
Using DELETE instead of REMOVE
Using SET to remove attributes
4fill in blank
hard

Fill both blanks to set 'Level' to 10 and add 20 to 'Points' in the update expression.

DynamoDB
UpdateExpression='SET Level = [1], Points = Points [2] 20'
Drag options to blanks, or click blank then click option'
A10
B+
C-
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus instead of plus
Setting wrong values
5fill in blank
hard

Fill all three blanks to set 'Status' to 'Active', increment 'Visits' by 1, and remove 'TempFlag'.

DynamoDB
UpdateExpression='SET Status = [1], Visits = Visits [2] 1 REMOVE [3]'
Drag options to blanks, or click blank then click option'
A'Active'
B+
CTempFlag
D'Inactive'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around strings
Using wrong attribute names