Bird
0
0

Identify the error in this DynamoDB table definition snippet:

medium📝 Debug Q6 of 15
AWS - DynamoDB

Identify the error in this DynamoDB table definition snippet:

{
  "AttributeDefinitions": [
    {"AttributeName": "UserId", "AttributeType": "S"}
  ],
  "KeySchema": [
    {"AttributeName": "UserId", "KeyType": "RANGE"}
  ]
}
AAttributeType should be N instead of S
BPartition key is missing; RANGE key cannot be alone
CKeyType RANGE is correct for partition key
DNo error; definition is valid
Step-by-Step Solution
Solution:
  1. Step 1: Check key schema requirements

    DynamoDB requires a partition key (KeyType=HASH) in key schema.
  2. Step 2: Identify missing partition key

    Only RANGE key is defined; partition key is missing, causing error.
  3. Final Answer:

    Partition key is missing; RANGE key cannot be alone -> Option B
  4. Quick Check:

    Partition key (HASH) is mandatory [OK]
Quick Trick: Partition key (HASH) must always be defined [OK]
Common Mistakes:
MISTAKES
  • Defining only RANGE key without HASH key
  • Confusing KeyType values
  • Assuming attribute type must be N

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes