0
0
DynamoDBquery~10 mins

Filter 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 filter items where the attribute 'status' equals 'active'.

DynamoDB
FilterExpression = "status = [1]"
Drag options to blanks, or click blank then click option'
A":active_status_val"
B":active_val"
C":active_status"
D":active"
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names instead of placeholders.
Forgetting the colon before the placeholder.
2fill in blank
medium

Complete the code to filter items where the attribute 'age' is greater than 25.

DynamoDB
FilterExpression = "age [1] :age_val"
Drag options to blanks, or click blank then click option'
A>
B<
C=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>'.
Using '=' which checks for equality, not greater than.
3fill in blank
hard

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

DynamoDB
FilterExpression = "score [1] :max_score"
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 invalid in DynamoDB filter expressions.
4fill in blank
hard

Fill both blanks to filter items where 'category' equals 'books' and 'price' is less than 20.

DynamoDB
FilterExpression = "category = [1] AND price [2] :max_price"
Drag options to blanks, or click blank then click option'
A:books
B>
C<
D:books_val
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' for price comparison.
Using incorrect placeholder names.
5fill in blank
hard

Fill all three blanks to filter items where 'status' equals 'pending', 'priority' is greater than 3, and 'assigned' attribute exists.

DynamoDB
FilterExpression = "status = [1] AND priority [2] :min_priority AND attribute_exists([3])"
Drag options to blanks, or click blank then click option'
A:pending
B>
Cassigned
D:pending_val
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names as placeholders.
Using '=' instead of '>' for priority comparison.
Not using attribute_exists() correctly.