Bird
0
0

Which of the following is the correct way to define a primary key in DynamoDB?

easy📝 Syntax Q3 of 15
AWS - DynamoDB
Which of the following is the correct way to define a primary key in DynamoDB?
APrimary key must be a combination of three attributes
BPrimary key consists of a partition key only or a partition key and sort key
CPrimary key is optional in DynamoDB tables
DPrimary key is always an auto-incrementing integer
Step-by-Step Solution
Solution:
  1. Step 1: Recall DynamoDB primary key structure

    DynamoDB requires a primary key that is either a partition key alone or a composite key with partition and sort keys.
  2. Step 2: Check other options for correctness

    Primary key must be a combination of three attributes is incorrect because DynamoDB does not use three attributes for primary keys. Primary key is optional in DynamoDB tables is false; primary key is mandatory. Primary key is always an auto-incrementing integer is wrong; DynamoDB keys are not auto-incremented.
  3. Final Answer:

    Primary key consists of a partition key only or a partition key and sort key -> Option B
  4. Quick Check:

    Primary key definition = B [OK]
Quick Trick: DynamoDB primary key = partition key [+ optional sort key] [OK]
Common Mistakes:
  • Thinking primary key can be optional
  • Assuming auto-increment keys like SQL
  • Believing primary key needs three attributes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes