0
0
DynamoDBquery~10 mins

Partition key selection in DynamoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the partition key attribute name in a DynamoDB table.

DynamoDB
KeySchema=[{"AttributeName": "[1]", "KeyType": "HASH"}]
Drag options to blanks, or click blank then click option'
AEmail
BTimestamp
CSortKey
DUserId
Attempts:
3 left
💡 Hint
Common Mistakes
Using the sort key attribute name as the partition key.
Choosing an attribute that is not unique.
2fill in blank
medium

Complete the code to specify the attribute type for the partition key in DynamoDB.

DynamoDB
AttributeDefinitions=[{"AttributeName": "UserId", "AttributeType": "[1]"}]
Drag options to blanks, or click blank then click option'
AN
BB
CS
DBOOL
Attempts:
3 left
💡 Hint
Common Mistakes
Using BOOL as an attribute type for partition key.
Confusing number (N) with string (S).
3fill in blank
hard

Fix the error in the partition key definition by completing the missing part.

DynamoDB
KeySchema=[{"AttributeName": "UserId", "KeyType": "[1]"}]
Drag options to blanks, or click blank then click option'
ARANGE
BHASH
CPRIMARY
DSORT
Attempts:
3 left
💡 Hint
Common Mistakes
Using RANGE instead of HASH for partition key.
Using invalid key types like PRIMARY or SORT.
4fill in blank
hard

Fill both blanks to define a composite key with partition and sort keys.

DynamoDB
KeySchema=[{"AttributeName": "[1]", "KeyType": "HASH"}, {"AttributeName": "[2]", "KeyType": "RANGE"}]
Drag options to blanks, or click blank then click option'
AUserId
BTimestamp
COrderDate
DEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping partition and sort key names.
Using non-unique attributes as partition key.
5fill in blank
hard

Fill all three blanks to define attribute definitions for a composite key.

DynamoDB
AttributeDefinitions=[{"AttributeName": "[1]", "AttributeType": "S"}, {"AttributeName": "[2]", "AttributeType": "[3]"}]
Drag options to blanks, or click blank then click option'
AUserId
BTimestamp
CN
DS
Attempts:
3 left
💡 Hint
Common Mistakes
Using string type for Timestamp when it should be number.
Mixing attribute names and types incorrectly.