0
0
DynamoDBquery~10 mins

Partition key distribution 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 specify the partition key attribute name in a DynamoDB table creation.

DynamoDB
KeySchema=[{'AttributeName': [1], 'KeyType': 'HASH'}]
Drag options to blanks, or click blank then click option'
A'UserId'
B'SortKey'
C'Timestamp'
D'IndexKey'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the sort key name instead of the partition key.
Confusing 'HASH' with 'RANGE' key types.
2fill in blank
medium

Complete the code to define the attribute type for the partition key in the attribute definitions.

DynamoDB
AttributeDefinitions=[{'AttributeName': 'UserId', 'AttributeType': [1]]
Drag options to blanks, or click blank then click option'
A'S'
B'BOOL'
C'B'
D'N'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'BOOL' which is not a valid attribute type for keys.
Confusing 'N' (number) with 'S' (string).
3fill in blank
hard

Fix the error in the partition key definition by choosing the correct key type.

DynamoDB
KeySchema=[{'AttributeName': 'UserId', 'KeyType': [1]]
Drag options to blanks, or click blank then click option'
A'RANGE'
B'HASH'
C'PRIMARY'
D'PARTITION'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'RANGE' for partition key.
Using invalid key types like 'PRIMARY' or 'PARTITION'.
4fill in blank
hard

Fill both blanks to create a DynamoDB table with a partition key and a sort key.

DynamoDB
KeySchema=[{'AttributeName': [1], 'KeyType': 'HASH'}, {'AttributeName': [2], 'KeyType': 'RANGE'}]
Drag options to blanks, or click blank then click option'
A'UserId'
B'Timestamp'
C'OrderId'
D'Category'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping partition and sort key names.
Using invalid attribute names for keys.
5fill in blank
hard

Fill all three blanks to define attribute definitions for a table with a string partition key and a number sort key.

DynamoDB
AttributeDefinitions=[{'AttributeName': [1], 'AttributeType': [2], {'AttributeName': [3], 'AttributeType': 'N'}]
Drag options to blanks, or click blank then click option'
A'UserId'
B'S'
C'Timestamp'
D'OrderId'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing attribute names and types.
Using wrong attribute types for keys.