Complete the code to define a DynamoDB table with a partition key.
TableName: "Users" KeySchema: - AttributeName: "UserId" KeyType: [1]
The partition key in DynamoDB is defined with KeyType 'HASH'. It uniquely identifies items in the table.
Complete the code to add a sort key to the DynamoDB table.
KeySchema: - AttributeName: "UserId" KeyType: "HASH" - AttributeName: "Timestamp" KeyType: [1]
The sort key in DynamoDB is defined with KeyType 'RANGE'. It allows sorting and querying within the partition.
Fix the error in the attribute definitions for the partition and sort keys.
AttributeDefinitions: - AttributeName: "UserId" AttributeType: [1] - AttributeName: "Timestamp" AttributeType: "S"
The partition key 'UserId' is usually a string, so its AttributeType should be 'S'.
Fill both blanks to complete the DynamoDB table creation snippet with partition and sort keys.
KeySchema: - AttributeName: [1] KeyType: "HASH" - AttributeName: [2] KeyType: "RANGE"
The partition key is 'UserId' and the sort key is 'Timestamp' to organize user data by time.
Fill all three blanks to define attribute types and key schema for a DynamoDB table with partition and sort keys.
AttributeDefinitions: - AttributeName: [1] AttributeType: [2] - AttributeName: [3] AttributeType: "N" KeySchema: - AttributeName: [1] KeyType: "HASH" - AttributeName: [3] KeyType: "RANGE"
'UserId' is the partition key with type 'S' (string), and 'Timestamp' is the sort key with type 'N' (number).