Bird
0
0

What will be the result of this DynamoDB scan on a table with items having attribute "Status" set to "Active" or "Inactive"?

medium📝 Predict Output Q5 of 15
AWS - DynamoDB
What will be the result of this DynamoDB scan on a table with items having attribute "Status" set to "Active" or "Inactive"?
{
  "TableName": "Users",
  "FilterExpression": "Status = :statusVal",
  "ExpressionAttributeValues": {":statusVal": {"S": "Active"}}
}
AReturns items where Status is "Inactive"
BReturns only items where Status is "Active"
CReturns all items regardless of Status
DThrows an error due to syntax
Step-by-Step Solution
Solution:
  1. Step 1: Understand FilterExpression usage

    FilterExpression filters items after scanning or querying based on condition.
  2. Step 2: Analyze the filter condition

    FilterExpression "Status = :statusVal" with value "Active" selects items with Status "Active" only.
  3. Final Answer:

    Returns only items where Status is "Active" -> Option B
  4. Quick Check:

    FilterExpression filters items = Returns only items where Status is "Active" [OK]
Quick Trick: FilterExpression narrows results after scan/query [OK]
Common Mistakes:
  • Expecting all items returned
  • Confusing filter with key condition
  • Assuming syntax error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes