Challenge - 5 Problems
DynamoDB Scan Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Scan with a simple filter expression
Given a DynamoDB table named Products with items having attributes
Category and Price, what will be the output of this scan operation?Scan with FilterExpression: Category = :cat
ExpressionAttributeValues: { ':cat': { S: 'Books' } }
DynamoDB
aws dynamodb scan --table-name Products --filter-expression "Category = :cat" --expression-attribute-values '{":cat":{"S":"Books"}}'
Attempts:
2 left
💡 Hint
FilterExpression filters items after scanning all; it matches exact values unless using functions.
✗ Incorrect
The filter expression 'Category = :cat' matches items where the Category attribute exactly equals 'Books'. It does not do substring matching or ignore the filter.
❓ query_result
intermediate2:00remaining
Scan with numeric filter expression
Consider a DynamoDB table Orders with attribute
Amount (number). What will this scan return?FilterExpression: Amount > :minAmount
ExpressionAttributeValues: { ':minAmount': { N: '100' } }
DynamoDB
aws dynamodb scan --table-name Orders --filter-expression "Amount > :minAmount" --expression-attribute-values '{":minAmount":{"N":"100"}}'
Attempts:
2 left
💡 Hint
Filter expressions support numeric comparisons like >, <, =.
✗ Incorrect
The filter expression 'Amount > :minAmount' returns items where Amount is strictly greater than 100.
📝 Syntax
advanced2:00remaining
Identify the syntax error in filter expression
Which option contains a syntax error in the DynamoDB scan filter expression?
DynamoDB
Scan command with filter expressions
Attempts:
2 left
💡 Hint
Check the comparison operator syntax carefully.
✗ Incorrect
The operator '=>' is invalid in DynamoDB filter expressions. The correct operator for greater or equal is '>='.
❓ query_result
advanced2:00remaining
Scan with multiple filter conditions
What items will be returned by this scan?
FilterExpression: "Category = :cat AND Price BETWEEN :low AND :high"
ExpressionAttributeValues: { ':cat': { S: 'Electronics' }, ':low': { N: '100' }, ':high': { N: '500' } }
DynamoDB
aws dynamodb scan --table-name Products --filter-expression "Category = :cat AND Price BETWEEN :low AND :high" --expression-attribute-values '{":cat":{"S":"Electronics"},":low":{"N":"100"},":high":{"N":"500"}}'
Attempts:
2 left
💡 Hint
AND operator combines conditions that must all be true.
✗ Incorrect
The filter expression requires both conditions to be true: Category equals 'Electronics' and Price is between 100 and 500 inclusive.
🧠 Conceptual
expert2:00remaining
Understanding scan with filter expressions and performance
Which statement best describes the behavior and performance impact of using filter expressions in DynamoDB scans?
Attempts:
2 left
💡 Hint
Think about when filtering happens during a scan operation.
✗ Incorrect
Filter expressions are applied after DynamoDB reads all items, so they do not reduce the amount of data read or the read capacity units consumed. They only reduce the data returned to the client.