Bird
0
0

What will be the result of this DynamoDB query on a table with ProductId as partition key and ReviewDate as sort key?

medium📝 service behavior Q5 of 15
AWS - DynamoDB

What will be the result of this DynamoDB query on a table with ProductId as partition key and ReviewDate as sort key?

Query: ProductId = 'A1' and ReviewDate BETWEEN '2023-01-01' AND '2023-01-31'
AItems with ProductId 'A1' and ReviewDate in January 2023
BItems with ReviewDate in January 2023 regardless of ProductId
CItems with ProductId 'A1' only
DNo items because BETWEEN is not supported
Step-by-Step Solution
Solution:
  1. Step 1: Understand BETWEEN operator

    BETWEEN filters sort key values within the specified range.
  2. Step 2: Combine with partition key condition

    Query returns items matching ProductId 'A1' and ReviewDate in January 2023.
  3. Final Answer:

    Items with ProductId 'A1' and ReviewDate in January 2023 -> Option A
  4. Quick Check:

    BETWEEN filters sort key range in query [OK]
Quick Trick: BETWEEN filters sort key values in range [OK]
Common Mistakes:
MISTAKES
  • Ignoring partition key condition
  • Assuming BETWEEN works on partition key
  • Thinking BETWEEN is unsupported

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes