0
0
DynamoDBquery~10 mins

Conditional expressions 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 check if the attribute 'status' equals 'active' in a DynamoDB conditional expression.

DynamoDB
ConditionExpression = "status = [1]"
Drag options to blanks, or click blank then click option'
A":val"
B":active"
C"active"
D":status"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the actual string 'active' without a placeholder.
Using attribute names instead of value placeholders.
2fill in blank
medium

Complete the code to check if the attribute 'age' is greater than 30 in a DynamoDB conditional expression.

DynamoDB
ConditionExpression = "age [1] :ageVal"
Drag options to blanks, or click blank then click option'
A>
B<=
C=
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of '>' for comparison.
Using '<' or '<=' which check for less than.
3fill in blank
hard

Fix the error in the conditional expression to check if 'score' is less than or equal to 100.

DynamoDB
ConditionExpression = "score [1] :maxScore"
Drag options to blanks, or click blank then click option'
A<=
B<
C>=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which excludes equality.
Using '==' which is not valid in DynamoDB expressions.
4fill in blank
hard

Fill both blanks to check if 'status' is 'pending' and 'priority' is greater than 5 in a DynamoDB conditional expression.

DynamoDB
ConditionExpression = "status = [1] AND priority [2] :prioVal"
Drag options to blanks, or click blank then click option'
A":pending"
B<
C>
D":status"
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names instead of value placeholders.
Using '<' instead of '>' for priority comparison.
5fill in blank
hard

Fill all three blanks to check if 'category' equals 'books', 'price' is less than 20, and 'inStock' is true in a DynamoDB conditional expression.

DynamoDB
ConditionExpression = "category = [1] AND price [2] :maxPrice AND inStock = [3]"
Drag options to blanks, or click blank then click option'
A":books"
B<
C:true
D":stock"
Attempts:
3 left
💡 Hint
Common Mistakes
Using actual strings instead of placeholders.
Using wrong comparison operators.
Using incorrect placeholders for boolean values.